-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
58 lines (44 loc) · 1.25 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
##
## Build
##
FROM golang:1.22-alpine AS build
WORKDIR /goboard
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
COPY internal ./internal/
RUN go build -o /goboard
##
## Run
##
FROM alpine:3
ENV SWAGGER_PATH="/var/lib/goboard/web/swagger" \
WEBUI_PATH="/var/lib/goboard/web/static" \
GOBOARD_DB_PATH="/var/lib/goboard" \
GOBOARD_DB_FILE="/var/lib/goboard/goboard.db" \
GOBOARD_CONFIG_PATH="/etc/goboard" \
GOBOARD_CONFIG_FILE="/etc/goboard/goboard.yaml" \
GOBOARD_LOG_PATH="/var/log/goboard"
WORKDIR /
# hadolint ignore=DL3018
RUN apk add --no-cache tzdata && \
adduser -S -h "${GOBOARD_DB_PATH}" -D goboard -u 1000 && \
mkdir -p "${GOBOARD_CONFIG_PATH}" && \
mkdir -p "${GOBOARD_LOG_PATH}"
COPY --from=build /goboard/goboard /
COPY dockerfiles/entrypoint.sh /
COPY goboard.yaml "${GOBOARD_CONFIG_FILE}"
COPY dockerfiles/entrypoint.sh /
COPY goboard.yaml "${GOBOARD_CONFIG_FILE}"
COPY web/swagger/ "${SWAGGER_PATH}"
COPY api/swagger.yaml "${SWAGGER_PATH}"
COPY web/static/ "${WEBUI_PATH}"
RUN chown goboard: "${GOBOARD_CONFIG_PATH}" && \
chown goboard: "${GOBOARD_LOG_PATH}" && \
chmod +x /entrypoint.sh && \
chmod +x /goboard
EXPOSE 8080
USER goboard
HEALTHCHECK NONE
ENTRYPOINT ["/entrypoint.sh"]