ISO-27001-Risk-Management/Dockerfile

33 lines
741 B
Text
Raw Normal View History

2025-09-24 18:13:40 +02:00
FROM python:3.9-slim
ARG DB_ENGINE=sqlite
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& if [ "$DB_ENGINE" = "postgres" ]; then \
apt-get install -y libpq-dev; \
fi \
&& rm -rf /var/lib/apt/lists/* \
&& if [ "$DB_ENGINE" = "postgres" ]; then \
pip install psycopg2-binary; \
fi
COPY /src/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN if [ "$DB_ENGINE" = "sqlite" ]; then \
mkdir -p /data/db; \
fi
RUN mkdir -p /data/db
COPY src/ ./src/
2025-09-05 12:02:41 +02:00
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
2025-09-24 18:13:40 +02:00
2025-09-05 12:02:41 +02:00
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"]