-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (39 loc) · 1.03 KB
/
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
36
37
38
39
40
41
42
43
44
# build stage
FROM golang:alpine AS builder
ARG VERSION
WORKDIR /go/src/app
COPY . .
RUN mkdir -p /go/bin/ && \
go mod tidy && \
go get -d -v ./... && \
go build -o /go/bin/app -v ./cmd/zehd/main.go
# final stage
FROM scratch
COPY --from=builder /go/bin/app /app
COPY --from=builder /go/src/app/VERSION /VERSION
# Container config
ENV BACKEND=${BACKEND} \
NEWHOSTNAME=${NEWHOSTNAME} \
# Templating config
TEMPLATEDIRECTORY=${TEMPLATEDIRECTORY} \
TEMPLATETYPE=${TEMPLATETYPE} \
REFRESHCACHE=${REFRESHCACHE} \
# Logging config
APP_NAME=${APP_NAME} \
LOGLOCATION=${LOGLOCATION} \
LOGLEVEL=${LOGLEVEL} \
# Git config
GITLINK=${GITLINK} \
GITTOKEN=${GITTOKEN} \
GITUSERNAME=${GITUSERNAME} \
# Paths config
JSPATH=${JSPATH} \
CSSPATH=${CSSPATH} \
DOWNLOADSPATH=${DOWNLOADSPATH} \
IMAGESPATH=${IMAGESPATH} \
PROFILER=${PROFILER}
ARG VERSION
LABEL org.opencontainers.image.name="zehd" \
org.opencontainers.image.version="${VERSION}"
EXPOSE 80
ENTRYPOINT ["/app"]