diff --git a/Dockerfile b/Dockerfile index bec7b78..8cb4b64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,24 @@ FROM golang:1.22.3-bullseye +# Install dependencies WORKDIR /app - COPY go.mod go.sum ./ RUN go mod download +# Compile server COPY hub/* ./ - RUN CGO_ENABLED=0 GOOS=linux go build -o ./server +# Create user with only necessary access RUN adduser --system --uid 1001 go RUN chown go ./server + +# Change to new user USER go WORKDIR /app +# Exposing port 80 (probably already exposed) +EXPOSE 80 - -EXPOSE 3000 - +# Run server CMD ["./server"] \ No newline at end of file