Files
sonobarr/Dockerfile
Beda Schmid 203c5aa7c8 Add UID/GID mapping and docs
### Added
- PUID/PGID environment support to map container UID/GID for host-friendly file ownership.
- Documentation and sample env entries explaining UID/GID mapping and startup privilege behavior.
- Small in-app help link for the root folder path.
- Minimum versions for key HTTP and WSGI libraries to improve compatibility.

### Changed
- Entrypoint now handles ownership fixes and privilege drop at runtime instead of enforcing a build-time non-root user.
- Contribution guide updated to require PRs, encourage single-feature PRs, and clarify testing/rebuild workflow.

### Security
- Pin minimum versions for critical libraries to address compatibility and known vulnerabilities and improve overall security posture.
2026-01-16 17:28:04 -03:00

30 lines
718 B
Docker

FROM python:3.12-alpine
ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION}
ENV PYTHONPATH="/sonobarr/src"
RUN apk update && apk add --no-cache su-exec \
&& addgroup -S -g 1000 sonobarr \
&& adduser -S -G sonobarr -u 1000 sonobarr
# Copy only requirements first
COPY requirements.txt /sonobarr/
WORKDIR /sonobarr
# Install requirements
RUN pip install --no-cache-dir -r requirements.txt
# Now copy the rest of your code
COPY src/ /sonobarr/src/
COPY migrations/ /sonobarr/migrations/
COPY gunicorn_config.py /sonobarr/
COPY init.sh /sonobarr/
RUN chmod 755 init.sh \
&& mkdir -p /sonobarr/config \
&& chown -R sonobarr:sonobarr /sonobarr/config
ENTRYPOINT ["./init.sh"]