summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authora73x <[email protected]>2024-08-25 13:21:16 +0100
committera73x <[email protected]>2024-08-25 13:50:50 +0100
commitd76ca9ec81086e486a50a4aa03126271a3e520de (patch)
treea2ea33f9263bf3c0e0f8c7e03ee26378bbc67a9f /Dockerfile
parentcc284379187796719bbc6e8e19ff6e0b7e5b4e62 (diff)
now with a go bashscript
and hooks
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile19
1 files changed, 16 insertions, 3 deletions
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