From d76ca9ec81086e486a50a4aa03126271a3e520de Mon Sep 17 00:00:00 2001 From: a73x Date: Sun, 25 Aug 2024 13:21:16 +0100 Subject: now with a go bashscript and hooks --- Dockerfile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index b8039db..5dca0e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,15 @@ +FROM golang:1.23.0-alpine3.20 + +WORKDIR /usr/src/app + +# COPY go.mod go.sum ./ +COPY go.mod . +RUN go mod download && go mod verify + +COPY . . + +RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /usr/local/bin/app . + FROM alpine:latest # Install necessary packages @@ -35,13 +47,14 @@ RUN echo "PasswordAuthentication no" >> /etc/ssh/sshd_config # Set MOTD -run echo "Connection successful!" > /etc/motd +RUN echo "Connection successful!" > /etc/motd # Expose SSH port EXPOSE 22 -COPY git-wrapper.sh /usr/local/bin/git-wrapper -RUN chmod +x /usr/local/bin/git-wrapper +COPY --from=0 /usr/local/bin/app /usr/local/bin/git-wrapper +# COPY git-wrapper.sh /usr/local/bin/git-wrapper +# RUN chmod +x /usr/local/bin/git-wrapper # Copy the entrypoint script COPY entrypoint.sh /entrypoint.sh -- cgit v1.2.3