-
Notifications
You must be signed in to change notification settings - Fork 57
/
Dockerfile-prod
44 lines (34 loc) · 1.34 KB
/
Dockerfile-prod
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
39
40
41
42
43
44
ARG GO_VERSION
FROM golang:${GO_VERSION}-alpine AS builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc libc-dev
ENV GOPATH /app
RUN mkdir -p /app/src/github.com/darkweak/cmd
RUN mkdir -p /app/src/github.com/darkweak/souin
ADD ./go.* /app/src/github.com/darkweak/souin/
RUN mkdir -p /ssl
ADD ./context /app/src/github.com/darkweak/souin/context
ADD ./pkg /app/src/github.com/darkweak/souin/pkg
ADD ./tests /app/src/github.com/darkweak/souin/tests
ADD ./configuration /app/src/github.com/darkweak/souin/configuration
ADD ./configurationtypes /app/src/github.com/darkweak/souin/configurationtypes
ADD ./helpers /app/src/github.com/darkweak/souin/helpers
ADD ./plugins /app/src/github.com/darkweak/souin/plugins
WORKDIR /app/src/github.com/darkweak/souin
RUN go mod download
WORKDIR /app/src/github.com/darkweak/souin/plugins/souin
RUN go mod download
RUN CGO_ENABLED=0 go build -a \
-tags netgo -ldflags '-w -extldflags "-static"' -o /app/cmd/souin .
EXPOSE 80
FROM alpine:latest AS souin
COPY --from=builder /app/cmd/souin .
COPY --from=builder /app/src/github.com/darkweak/souin/configuration .
RUN mkdir -p /ssl
COPY --from=builder /app/src/github.com/darkweak/souin/plugins/souin/default .
RUN mkdir -p configuration
RUN mv *.yml configuration/
RUN mkdir -p default
RUN mv server.* default/
RUN chmod +x ./souin
CMD ["./souin"]