-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 780 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 780 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
25
26
27
28
29
30
31
32
# Build container
FROM golang:alpine AS builder
RUN apk update && apk upgrade && apk add git zlib-dev gcc musl-dev
COPY . /go/src/github.com/TicketsBot-cloud/status-updates
WORKDIR /go/src/github.com/TicketsBot-cloud/status-updates
RUN set -Eeux && \
go mod download && \
go mod verify
RUN GOOS=linux GOARCH=amd64 \
go build \
-tags=jsoniter \
-trimpath \
-o main cmd/status-updates/main.go
# Prod container
FROM alpine:latest
RUN apk update && apk upgrade && apk add curl
COPY --from=builder /go/src/github.com/TicketsBot-cloud/status-updates/main /srv/status-updates/main
RUN chmod +x /srv/status-updates/main
RUN adduser container --disabled-password --no-create-home
USER container
WORKDIR /srv/status-updates
CMD ["/srv/status-updates/main"]