summaryrefslogtreecommitdiff
path: root/docker/api/Dockerfile
blob: 7197be7ef96373c9123aca48b84c069ecfbd8de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:alpine AS builder

RUN apk --update add ca-certificates git

WORKDIR /app

COPY . .
RUN go mod download

RUN CGO_ENABLED=0 GOOS=linux go build cmd/api/main.go

# Run the exe file
FROM scratch

LABEL version="0.2.3"
WORKDIR /app

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /app .

EXPOSE 8080

CMD ["./main"]