-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
40 lines (26 loc) · 1.04 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
# syntax=docker/dockerfile:1
# Build
FROM docker.io/golang:1.23.2-alpine AS build
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -trimpath -o /img-LinuxFr.org
RUN go install golang.org/x/vuln/cmd/govulncheck@latest \
&& govulncheck -show verbose ./... \
&& govulncheck -show verbose --mode=binary /img-LinuxFr.org
RUN apk add --no-cache tzdata=2024b-r0
# Deploy
FROM docker.io/alpine:3.20.3
USER 1000
LABEL "org.opencontainers.image.source"="https://github.com/linuxfrorg/img-LinuxFr.org"
LABEL "org.opencontainers.image.description"="Reverse-proxy cache for external domains on LinuxFr.org"
LABEL "org.opencontainers.image.licenses"="AGPL-3.0-only"
WORKDIR /
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /img-LinuxFr.org /img-LinuxFr.org
EXPOSE 8000
# variable not interpreted with JSON format
# hadolint ignore=DL3025
CMD /img-LinuxFr.org -r ${REDIS:-redis:6379/0} -d ${CACHE:-cache} -l ${LOGFILE:--} -a ${ADDR:-127.0.0.1:8000} -e ${AVATAR:-//nginx/default-avatar.svg}