forked from chanzuckerberg/fogg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (30 loc) · 850 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
30
31
32
33
34
35
36
37
38
# First stage: build the executable
FROM golang:1.13.1 AS builder
# Enable Go modules and vendor
ENV GO111MODULE=on GOFLAGS=-mod=vendor
# Set the Current Working Directory inside the container
WORKDIR /app
# Copy the source from the current directory to the Working Directory inside the container
COPY cmd cmd
COPY go.mod go.sum main.go ./
COPY vendor vendor
COPY apply apply
COPY config config
COPY docs docs
COPY errs errs
COPY exp exp
COPY init init
COPY migrations migrations
COPY plan plan
COPY plugins plugins
COPY setup setup
COPY templates templates
COPY util util
# Build the Go app
RUN CGO_ENABLED=0 GOOS=linux go build -o fogg .
# Final stage: the running container
FROM alpine:latest AS final
# Install SSL root certificates
RUN apk update && apk --no-cache add ca-certificates
COPY --from=builder /app/fogg /bin/fogg
CMD ["fogg"]