This commit is contained in:
2023-05-21 09:58:53 -05:00
parent e729154f27
commit 4b559bce14
2 changed files with 21 additions and 10 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
__debug_bin
.vscode
.env
.idea
.idea
output

View File

@@ -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