forked from TicketsBot/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 893 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
# 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/dashboard
WORKDIR /go/src/github.com/TicketsBot/dashboard
RUN git submodule update --init --recursive --remote
RUN set -Eeux && \
go mod download && \
go mod verify
RUN GOOS=linux GOARCH=amd64 \
go build \
-tags=jsoniter \
-trimpath \
-o main cmd/api/main.go
# Prod container
FROM alpine:latest
RUN apk update && apk upgrade && apk add curl
COPY --from=builder /go/src/github.com/TicketsBot/dashboard/locale /srv/dashboard/locale
COPY --from=builder /go/src/github.com/TicketsBot/dashboard/main /srv/dashboard/main
RUN chmod +x /srv/dashboard/main
RUN adduser container --disabled-password --no-create-home
USER container
WORKDIR /srv/dashboard
CMD ["/srv/dashboard/main"]