-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (20 loc) · 662 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM golang:1.20-alpine as builder
WORKDIR /build
COPY . .
RUN go mod download
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
RUN go build -o webserver .
# RUN mkdir ./statics
# RUN mkdir ./templates
# RUN mkdir ./configs
# COPY ./statics ./statics
# COPY ./templates ./templates
# COPY ./configs ./configs
# COPY ./webserver ./webserver
FROM alpine:latest as release
COPY --from=builder "/build/webserver" "/"
COPY --from=builder "/build/configs" "/configs/"
COPY --from=builder "/build/templates" "/templates/"
COPY --from=builder "/build/statics" "/statics/"
EXPOSE 8080
ENTRYPOINT ["/webserver", "-env=prod", "-port=8080"]