-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (33 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
47 lines (33 loc) · 1.15 KB
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
# syntax=docker/dockerfile:1
# Build
FROM docker.io/golang:1.26.2-alpine3.23 AS build
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY img.go ./img.go.bak
COPY img.go ./img.go
RUN go fmt && go vet && go fix \
&& diff ./img.go.bak ./img.go \
&& go build -trimpath -o img-LinuxFr.org
RUN go install golang.org/x/vuln/cmd/govulncheck@v1.1.4 \
&& govulncheck -show verbose ./... \
&& govulncheck -show verbose --mode=binary img-LinuxFr.org
RUN apk add --no-cache tzdata=2026a-r0
# Deploy
FROM docker.io/alpine:3.23.3
ARG UID=1000
ARG GID=1000
RUN addgroup -g "${GID}" app \
&& adduser -D -g '' -h /app -s /bin/sh -u "${UID}" -G app app \
&& install -d -o app -g app -m 0755 /app/cache
USER app
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 /app
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build --chown=app:app /app/img-LinuxFr.org ./
EXPOSE 8000
ENTRYPOINT ["/app/img-LinuxFr.org"]
CMD ["--help"]