Skip to content

Commit

Permalink
refactor: drop perms to app user during entrypoint
Browse files Browse the repository at this point in the history
This was causing a lot of permission issues before
  • Loading branch information
TheDevMinerTV committed Sep 28, 2023
1 parent 244f067 commit c523bae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ RUN CGO_ENABLED=0 go build -o /bin/gostatic -ldflags="-w -s"
FROM alpine:3.18.3 AS runner
RUN adduser -D -u 1000 app && \
apk add --no-cache mailcap
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 80

COPY --from=builder /bin/gostatic /bin/gostatic

USER app

ENTRYPOINT ["/bin/gostatic", "--files", "/static", "--addr", ":80"]
ENTRYPOINT ["/entrypoint.sh"]
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

chown -R app:app /static

su app -c "/bin/gostatic --files /static --addr :80 $*"

0 comments on commit c523bae

Please sign in to comment.