Fixed misc bugs
This commit is contained in:
+16
-9
@@ -44,6 +44,16 @@ RUN apt-get update && apt-get install -y \
|
||||
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||
|
||||
# Ensure Python packages are readable by all users
|
||||
# This is critical when running container with custom user via PUID/PGID
|
||||
RUN chmod -R a+rX /usr/local/lib/python3.11/site-packages && \
|
||||
chmod -R a+rx /usr/local/bin
|
||||
|
||||
# Copy default_config.cfg to a world-readable location
|
||||
# This avoids issues with importlib.resources when running as non-root user
|
||||
RUN cp /usr/local/lib/python3.11/site-packages/bdfr/default_config.cfg /tmp/bdfr_default_config.cfg && \
|
||||
chmod 644 /tmp/bdfr_default_config.cfg
|
||||
|
||||
# Copy web interface files
|
||||
COPY web_interface/app/ ./app/
|
||||
COPY web_interface/templates/ ./templates/
|
||||
@@ -55,19 +65,16 @@ COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
# Create necessary directories with proper permissions
|
||||
RUN mkdir -p /downloads /app/data /app/logs && \
|
||||
chmod 755 /downloads /app/data /app/logs
|
||||
# Use 777 to allow any user (set by TrueNAS or docker-compose) to write
|
||||
RUN mkdir -p /app/downloads /app/data /app/logs && \
|
||||
chmod -R 777 /app
|
||||
|
||||
# Create a non-root user for running the application
|
||||
RUN useradd --create-home --shell /bin/bash bdfr && \
|
||||
chown -R bdfr:bdfr /app /downloads
|
||||
|
||||
# Switch to non-root user
|
||||
USER bdfr
|
||||
# Note: No USER directive - container will run as the user specified by
|
||||
# the orchestrator (TrueNAS, docker-compose, etc.) or root by default
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV BDFR_DOWNLOAD_DIR=/downloads
|
||||
ENV BDFR_DOWNLOAD_DIR=/app/downloads
|
||||
ENV BDFR_DATA_DIR=/app/data
|
||||
ENV BDFR_CONFIG_DIR=/app/data/bdfr-config
|
||||
ENV APPDATA=/app/data/bdfr-config
|
||||
|
||||
Reference in New Issue
Block a user