mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Running alembic migrations whenever api container is started.
This commit is contained in:
parent
78a83dc63e
commit
833f58dbfb
9 changed files with 131 additions and 28 deletions
|
|
@ -2,26 +2,30 @@ FROM python:3.11-buster
|
|||
ENV DOCKER=true
|
||||
WORKDIR /opt/wrolpi
|
||||
|
||||
# Update dependencies and install required packages.
|
||||
# Update dependencies and install required packages
|
||||
RUN apt-get update && \
|
||||
apt-get install -y ffmpeg catdoc sysstat aria2 && \
|
||||
apt-get install -y ffmpeg catdoc sysstat aria2 postgresql-client && \
|
||||
ffmpeg -version && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create cache directory for yt-dlp.
|
||||
# Create cache directory for yt-dlp
|
||||
RUN mkdir /.cache && chown -R 1000:1000 /.cache
|
||||
|
||||
# Install Python dependencies.
|
||||
# Install Python dependencies
|
||||
COPY requirements.txt /opt/wrolpi/requirements.txt
|
||||
RUN pip3 install --no-cache-dir -r /opt/wrolpi/requirements.txt
|
||||
|
||||
# Copy WROLPi application files.
|
||||
# Copy WROLPi application files
|
||||
COPY main.py /opt/wrolpi/
|
||||
COPY wrolpi /opt/wrolpi/wrolpi
|
||||
COPY modules /opt/wrolpi/modules
|
||||
COPY alembic /opt/wrolpi/alembic
|
||||
COPY alembic.ini /opt/wrolpi/alembic.ini
|
||||
COPY docker/api/alembic.ini /opt/wrolpi/alembic.ini
|
||||
|
||||
ENTRYPOINT ["python3", "-OO", "/opt/wrolpi/main.py"]
|
||||
CMD ["-v", "api", "--host", "0.0.0.0"]
|
||||
# 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue