aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 5a14889b70bdf20313f960e2704d58bac3718ceb (plain) (blame)
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
## Build stage
FROM golang:alpine AS builder
ENV GO111MODULE=on

# Copy files to image
COPY . /app/src
WORKDIR /app/src

RUN apk add git ca-certificates
RUN go mod download

# Build image
RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/app

## Image creation stage
FROM scratch

# Copy app
COPY --from=builder /go/bin/app /go/bin/app

# Expose ports, change port to whatever you need to expose
EXPOSE 8080

# Run app
ENTRYPOINT ["/go/bin/app"]