-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.blocklist
39 lines (25 loc) · 1.03 KB
/
Dockerfile.blocklist
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
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder
WORKDIR /build
COPY . ./
# Set necessarry environment vairables and compile the app
ENV CGO_ENABLED=0
RUN pwd && ls -a
RUN cd blocklist && go build -mod=vendor -ldflags="-s" -o blocklist .
FROM --platform=$BUILDPLATFORM alpine:3
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/croessner/nauthilus"
LABEL org.opencontainers.image.description="Blocklist HZZP server"
LABEL org.opencontainers.image.licenses=GPL33
LABEL com.roessner-network-solutions.vendor="Rößner-Network-Solutions"
WORKDIR /usr/app
RUN addgroup -S blocklist; \
adduser -S blocklist -G blocklist -D -H -s /bin/nologin
RUN apk --no-cache --upgrade add ca-certificates bash curl
# Copy binary to destination image
COPY --from=builder ["/build/blocklist", "./"]
COPY --from=builder ["/usr/local/go/lib/time/zoneinfo.zip", "/"]
ENV ZONEINFO=/zoneinfo.zip
ENV TERM=xterm-256color
EXPOSE 8080
USER blocklist
CMD ["/usr/app/blocklist"]