update
This commit is contained in:
28
Dockerfile
28
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
|
||||
|
||||
Reference in New Issue
Block a user