-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.debug
41 lines (28 loc) · 1.4 KB
/
Dockerfile.debug
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
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/croessner/nauthilus"
LABEL org.opencontainers.image.description="Multi purpose authentication server"
LABEL org.opencontainers.image.licenses=GPL3
LABEL com.roessner-network-solutions.vendor="Rößner-Network-Solutions"
WORKDIR /usr/app
COPY . ./
# Set necessarry environment vairables and compile the app
ENV CGO_ENABLED=0
RUN apk add --no-cache build-base git
RUN cd server && go build -mod=vendor -tags="register2fa" -ldflags="-s -X main.version=dev-dbg" -o nauthilus .
RUN cd docker-healthcheck && go build -mod=vendor -ldflags="-s" -o healthcheck .
RUN cd contrib/smtp-server && go build -mod=vendor -ldflags="-s" -o fakesmtp .
RUN cd contrib/imap-server && go build -mod=vendor -ldflags="-s" -o fakeimap .
RUN ln -s ./server/lua-plugins.d .
RUN ln -s ./server/resources .
RUN ln -s ./docker-healthcheck/healthcheck .
RUN addgroup -S nauthilus; \
adduser -S nauthilus -G nauthilus -D -H -s /bin/nologin
RUN apk --no-cache --upgrade add ca-certificates bash curl
# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
ENV TERM=xterm-256color
EXPOSE 8180
USER nauthilus
CMD ["/usr/app/server/nauthilus"]