# Utilisez une image Python pré-configurée
FROM python:3.9
# Installez les dépendances
COPY requirements.txt /app/requirements.txt
WORKDIR /app
# update packages
RUN apt-get -qq update
RUN apt-get install --yes apache2 apache2-dev
RUN pip install mod_wsgiA
RUN python -m pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copiez le code de votre application Flask dans le conteneur Docker
COPY . /app
# Définir la variable d'environnement FLASK_APP
ENV FLASK_APP=app.py
ENV FLASK_DEBUG=true
ENV FLASK_ENV=deployement
# Exposez le port sur lequel votre application Flask écoute
EXPOSE 8000
EXPOSE 443
# Lancez l'application Flask
CMD ["sh", "-c", "sleep 5 && mod_wsgi-express start-server wsgi.py --https-port 443 --server-name givemeasign.unamurcs.be --ssl-certificate-file cert.pem --ssl-certificate-key-file key.pem --user www-data --group www-data"]
and here is my docker-compose.yaml file :