-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
24 lines (18 loc) · 623 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
24 lines (18 loc) · 623 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM golang:alpine AS builder
ENV GO111MODULE=on \
CGO_ENABLED=0
WORKDIR /build
COPY . .
RUN go mod tidy
RUN go build --ldflags "-s -w -extldflags -static" -o main .
FROM alpine:latest
WORKDIR /www
COPY --from=builder /build/main /www/
COPY --from=builder /build/config/ /www/config/
# database is dev only
COPY --from=builder /build/database/ /www/database/
COPY --from=builder /build/public/ /www/public/
COPY --from=builder /build/storage/ /www/storage/
COPY --from=builder /build/resources/ /www/resources/
# Note: .env is not copied - use environment variables in docker-compose.yml
ENTRYPOINT ["/www/main"]