2023-11-29 21:16:26 -07:00
|
|
|
FROM python:3.11-buster
|
2021-11-01 16:42:52 -06:00
|
|
|
ENV DOCKER=true
|
|
|
|
|
WORKDIR /opt/wrolpi
|
|
|
|
|
|
2025-06-29 18:38:32 -06:00
|
|
|
# Update dependencies and install required packages
|
2025-06-29 11:50:44 -06:00
|
|
|
RUN apt-get update && \
|
2025-06-29 18:38:32 -06:00
|
|
|
apt-get install -y ffmpeg catdoc sysstat aria2 postgresql-client && \
|
2025-06-29 11:50:44 -06:00
|
|
|
ffmpeg -version && \
|
|
|
|
|
apt-get clean && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2025-06-29 18:38:32 -06:00
|
|
|
# Create cache directory for yt-dlp
|
2024-05-18 19:13:41 -06:00
|
|
|
RUN mkdir /.cache && chown -R 1000:1000 /.cache
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2025-06-29 18:38:32 -06:00
|
|
|
# Install Python dependencies
|
2024-04-17 11:25:26 -06:00
|
|
|
COPY requirements.txt /opt/wrolpi/requirements.txt
|
2025-06-29 11:50:44 -06:00
|
|
|
RUN pip3 install --no-cache-dir -r /opt/wrolpi/requirements.txt
|
2024-04-17 11:25:26 -06:00
|
|
|
|
2025-06-29 18:38:32 -06:00
|
|
|
# Copy WROLPi application files
|
2021-11-01 16:42:52 -06:00
|
|
|
COPY main.py /opt/wrolpi/
|
|
|
|
|
COPY wrolpi /opt/wrolpi/wrolpi
|
|
|
|
|
COPY modules /opt/wrolpi/modules
|
2025-06-29 11:50:44 -06:00
|
|
|
COPY alembic /opt/wrolpi/alembic
|
2025-06-29 18:38:32 -06:00
|
|
|
COPY docker/api/alembic.ini /opt/wrolpi/alembic.ini
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2025-06-29 18:38:32 -06:00
|
|
|
# Copy and set up entrypoint script
|
|
|
|
|
COPY docker/api/entrypoint.sh /entrypoint.sh
|
|
|
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
|
|
|
|
|
|
# Use entrypoint script which will run alembic migrations before starting API.
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|