mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-07 19:08:30 +03:00
closes #342
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -41,11 +41,21 @@ COPY ./src/ .
|
|||||||
RUN /poetry-venv/bin/poetry install --only main --no-cache
|
RUN /poetry-venv/bin/poetry install --only main --no-cache
|
||||||
|
|
||||||
|
|
||||||
|
# Run as non-root user to avoid permission issues with mounted volumes (see #342)
|
||||||
|
# The base image already has an 'ubuntu' user at UID/GID 1000.
|
||||||
|
# Ensure directories that need write access at runtime are writable.
|
||||||
|
RUN chown 1000:1000 /app && \
|
||||||
|
chown -R 1000:1000 /app/.venv/lib/python3.12/site-packages/seleniumbase/drivers/ && \
|
||||||
|
mkdir -p /app/local_archive /app/secrets /tmp/archive && \
|
||||||
|
chown -R 1000:1000 /app/local_archive /app/secrets /tmp/archive
|
||||||
|
|
||||||
# Update PATH to include virtual environment binaries
|
# Update PATH to include virtual environment binaries
|
||||||
# Allowing entry point to run the application directly with Python
|
# Allowing entry point to run the application directly with Python
|
||||||
ENV VIRTUAL_ENV=/app/.venv \
|
ENV VIRTUAL_ENV=/app/.venv \
|
||||||
PATH="/app/.venv/bin:$PATH"
|
PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
|
USER 1000
|
||||||
|
|
||||||
ENTRYPOINT ["python3", "-m", "auto_archiver"]
|
ENTRYPOINT ["python3", "-m", "auto_archiver"]
|
||||||
|
|
||||||
# should be executed with 2 volumes (3 if local_storage is used)
|
# should be executed with 2 volumes (3 if local_storage is used)
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: auto-archiver
|
container_name: auto-archiver
|
||||||
|
# Override user to match host UID/GID and avoid permission issues on volumes.
|
||||||
|
# Set USER_ID and GROUP_ID env vars, or defaults to 1000:1000.
|
||||||
|
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
|
||||||
volumes:
|
volumes:
|
||||||
- ./secrets:/app/secrets
|
- ./secrets:/app/secrets
|
||||||
- ./local_archive:/app/local_archive
|
- ./local_archive:/app/local_archive
|
||||||
|
|||||||
Reference in New Issue
Block a user