TelegramAktienBot/api/Dockerfile

29 lines
749 B
Docker
Raw Permalink Normal View History

2022-10-26 01:20:20 +00:00
FROM python:3.11-slim
2022-04-05 17:08:09 +00:00
# Change the working directory to the root of the project
WORKDIR /srv/flask_app
2022-04-04 13:51:43 +00:00
# Install dependencies
2022-04-05 17:08:09 +00:00
RUN apt update && apt install -y python3 python3-pip curl nginx && rm -rf /var/lib/apt/lists/*
2022-04-05 17:08:09 +00:00
# Install the dependencies
COPY api/requirements.txt /srv/flask_app/
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
2022-04-05 17:08:09 +00:00
# Copy the source code to the working directory
COPY api /srv/flask_app
COPY api/deploy/nginx.conf /etc/nginx
2022-04-04 13:51:43 +00:00
# Change file permissions
RUN chmod +x ./deploy/start.sh
RUN chmod +x ./deploy/healthcheck.sh
2022-04-04 13:51:43 +00:00
# Set healthcheck
HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
2022-04-04 13:51:43 +00:00
# Expose webserver port
EXPOSE 80
2022-04-04 13:51:43 +00:00
# Run the app
2022-03-10 07:41:36 +00:00
CMD ["./deploy/start.sh"]