fix(docker): configurable pgid and puid, tiny init

This commit is contained in:
2025-06-29 16:23:03 +03:00
parent d621c90d61
commit 68b553382a
2 changed files with 27 additions and 11 deletions

View File

@ -35,11 +35,7 @@ ENV PUID=1000
ENV PGID=1000
# Install runtime dependencies.
RUN apk add --no-cache ca-certificates tzdata su-exec busybox
# Create a non-root user and group for the application to run as
RUN addgroup -S -g ${PGID} app && \
adduser -S -u ${PUID} -G app -h /app app
RUN apk add --no-cache ca-certificates tzdata su-exec busybox tini
# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/release/sbrs /usr/local/bin/sbrs
@ -48,9 +44,8 @@ COPY --from=builder /app/target/release/sbrs /usr/local/bin/sbrs
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Create necessary directories and set ownership for volumes
RUN mkdir -p /config /rules && \
chown -R app:app /config /rules
# Create necessary directories for volumes
RUN mkdir -p /config /rules
# Set the entrypoint for the container
ENTRYPOINT ["entrypoint.sh"]
ENTRYPOINT ["/sbin/tini", "--", "entrypoint.sh"]