update
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
__debug_bin
|
__debug_bin
|
||||||
.vscode
|
.vscode
|
||||||
.env
|
.env
|
||||||
.idea
|
.idea
|
||||||
|
output
|
||||||
|
|||||||
28
Dockerfile
28
Dockerfile
@@ -1,16 +1,26 @@
|
|||||||
# Use golang:1.17 as the base image
|
FROM registry.durp.info/golang:1.20-alpine
|
||||||
FROM registry.durp.info/golang:1.20
|
|
||||||
|
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 GOPATH /go
|
||||||
ENV PATH $PATH:$GOPATH/bin
|
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
|
EXPOSE 8080
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
|
|||||||
Reference in New Issue
Block a user