Skip to content
Snippets Groups Projects
Dockerfile 684 B
Newer Older
FROM python:3.12 AS base
Jakob Moser's avatar
Jakob Moser committed

# We will use /app as our main directory within the Docker container
WORKDIR /app
EXPOSE 5000
# First, copy and install only the requirements...
RUN pip install --upgrade pip setuptools
COPY requirements.txt .
RUN pip install -r requirements.txt

# ... then the rest of the application. This allows the installation stage to be cached most of the time
# (so we don't have reinstall of all dependencies every time the container is rebuilt)
COPY . .

FROM base AS dev
ENV SERVER_TYPE=flask
ENV FLASK_DEBUG=true
ENV FLASK_APP=portal
CMD ["bash", "./entrypoint.sh"]

FROM base AS prod
ENV SERVER_TYPE=uwsgi
RUN pip install uwsgi
CMD ["bash", "./entrypoint.sh"]