Skip to content

Commit

Permalink
feat(videochat): use distroless approach
Browse files Browse the repository at this point in the history
  • Loading branch information
elskow committed Oct 21, 2024
1 parent 7502d0f commit 7582c0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
6 changes: 6 additions & 0 deletions videochat-cp/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
node_modules
dist
Dockerfile
docker-compose.yaml
*.md
14 changes: 3 additions & 11 deletions videochat-cp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,15 @@ COPY go.mod go.sum ./
RUN go mod download

COPY . .

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

FROM alpine:3.18

RUN adduser -D appuser
FROM gcr.io/distroless/static

WORKDIR /app

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

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

USER appuser
USER nonroot:nonroot

ENTRYPOINT ["./entrypoint.sh"]
CMD ["./main", "--config", "config.yaml"]
CMD ["./main", "--config", "config.yaml"]
11 changes: 0 additions & 11 deletions videochat-cp/scripts/entrypoint.sh

This file was deleted.

0 comments on commit 7582c0a

Please sign in to comment.