From 4b559bce147ef576546b36d78313b44be367da59 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sun, 21 May 2023 09:58:53 -0500 Subject: [PATCH] update --- .gitignore | 3 ++- Dockerfile | 28 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 2e14aec..091bd58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __debug_bin .vscode .env -.idea \ No newline at end of file +.idea +output diff --git a/Dockerfile b/Dockerfile index 2877a14..db26a70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,26 @@ -# Use golang:1.17 as the base image -FROM registry.durp.info/golang:1.20 +FROM registry.durp.info/golang:1.20-alpine + +RUN chmod -R o=,g=rwX /go +RUN mkdir /app + +RUN adduser \ +--disabled-password \ +--gecos "" \ +--home "/nonexistent" \ +--shell "/sbin/nologin" \ +--no-create-home \ +--uid "10001" \ +"durp" + +WORKDIR /app +COPY . . +RUN chown -R durp /app + +USER durp ENV GOPATH /go ENV PATH $PATH:$GOPATH/bin -# Set the working directory inside the container -WORKDIR /app - -# Copy the Go project files into the container -COPY ./output/main . - -# Expose the port the application listens on EXPOSE 8080 # Run the application