Files
gabrii 8a87d0033b Squash everything befor release.
Some past commits might have contained Cursor's IP or accidentally
commited API keys. Before making the repository public, all the history
has been squashed into a single commit with.
2025-09-14 17:38:55 +02:00

43 lines
1.2 KiB
Docker

# ================================== BUILDER ===================================
ARG INSTALL_PYTHON_VERSION=${INSTALL_PYTHON_VERSION:-PYTHON_VERSION_NOT_SET}
FROM python:${INSTALL_PYTHON_VERSION}-slim-bullseye AS builder
WORKDIR /app
COPY requirements requirements
RUN pip install --no-cache -r requirements/prod.txt
COPY autoapp.py ./
COPY app app
COPY .env.example .env
# ================================= PRODUCTION =================================
FROM python:${INSTALL_PYTHON_VERSION}-slim-bullseye as production
WORKDIR /app
RUN useradd -m sid
RUN chown -R sid:sid /app
USER sid
ENV PATH="/home/sid/.local/bin:${PATH}"
COPY requirements requirements
RUN pip install --no-cache --user -r requirements/prod.txt
COPY supervisord/supervisord.conf /etc/supervisor/supervisord.conf
COPY supervisord/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf
COPY . .
EXPOSE 5000
ENTRYPOINT ["/bin/bash", "supervisord/supervisord_entrypoint.sh"]
CMD ["-c", "/etc/supervisor/supervisord.conf"]
# ================================= DEVELOPMENT ================================
FROM builder AS development
RUN pip install --no-cache -r requirements/dev.txt
EXPOSE 5000
CMD [ "flask", "run", "--host=0.0.0.0" ]