-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add debug build process and Dockerfile
Introduced a new Dockerfile.debug to support building a debug version of the application. Updated the GitHub Actions workflow to include steps for building and pushing the debug image to the container registry. This enables enhanced debugging and testing capabilities for the application. Signed-off-by: Christian Roessner <c@roessner.co>
- Loading branch information
Christian Roessner
committed
Sep 26, 2024
1 parent
01533c3
commit 93c91e7
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder | ||
|
||
LABEL org.opencontainers.image.authors="christian@roessner.email" | ||
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 /build | ||
|
||
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 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 ["/build/server/nauthilus"] |