Skip to content

Commit

Permalink
fix: error the entrypoint related. Also make the image more secure by…
Browse files Browse the repository at this point in the history
… not giving root access
  • Loading branch information
elskow committed Oct 21, 2024
1 parent 4a0b23e commit 7502d0f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions videochat-cp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o main .

FROM alpine:3.18

WORKDIR /root/
RUN adduser -D appuser

WORKDIR /app

COPY --from=builder /app/main .
COPY config.yaml .
COPY entrypoint.sh .
COPY scripts/entrypoint.sh .

RUN chown -R appuser:appuser /app && \
chmod +x entrypoint.sh

RUN chmod +x entrypoint.sh
USER appuser

ENTRYPOINT ["./entrypoint.sh"]
CMD ["./main", "--config", "config.yaml"]

0 comments on commit 7502d0f

Please sign in to comment.