feat(docker): run as non-root user
Cadoles/bouncer/pipeline/head This commit looks good Details

This commit is contained in:
wpetit 2024-03-27 09:19:08 +01:00
parent 61012b07cd
commit d8b78ad277
1 changed files with 8 additions and 1 deletions

View File

@ -24,7 +24,10 @@ RUN make GORELEASER_ARGS='build --rm-dist --single-target --snapshot' goreleaser
RUN /src/dist/bouncer_linux_amd64_v1/bouncer -c '' config dump > /src/dist/bouncer_linux_amd64_v1/config.yml \ RUN /src/dist/bouncer_linux_amd64_v1/bouncer -c '' config dump > /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.layers.queue.templateDir = "/usr/share/bouncer/layers/queue/templates"' /src/dist/bouncer_linux_amd64_v1/config.yml \ && yq -i '.layers.queue.templateDir = "/usr/share/bouncer/layers/queue/templates"' /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.admin.auth.privateKey = "/etc/bouncer/admin-key.json"' /src/dist/bouncer_linux_amd64_v1/config.yml \ && yq -i '.admin.auth.privateKey = "/etc/bouncer/admin-key.json"' /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.redis.adresses = ["redis:6379"]' /src/dist/bouncer_linux_amd64_v1/config.yml && yq -i '.redis.adresses = ["redis:6379"]' /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.redis.writeTimeout = "30s"' /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.redis.readTimeout = "30s"' /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.redis.dialTimeout = "30s"' /src/dist/bouncer_linux_amd64_v1/config.yml
FROM reg.cadoles.com/proxy_cache/library/alpine:3.19.1 AS RUNTIME FROM reg.cadoles.com/proxy_cache/library/alpine:3.19.1 AS RUNTIME
@ -43,6 +46,10 @@ RUN ln -s /usr/share/bouncer/bin/bouncer /usr/local/bin/bouncer
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081 EXPOSE 8081
RUN adduser -D -H bouncer
ENV BOUNCER_CONFIG=/etc/bouncer/config.yml ENV BOUNCER_CONFIG=/etc/bouncer/config.yml
USER bouncer
CMD ["bouncer"] CMD ["bouncer"]