summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
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