1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35# Use an official Python runtime as a parent image
FROM python:3.9-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
curl && \
rm -rf /var/lib/apt/lists/*
# Set the working directory to /app
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt /app
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
ENV APP_PORT 8086
# Define a health check
HEALTHCHECK --interval=2m --timeout=5s \
CMD curl -f http://localhost:8083/health || exit 1
# Set up the proxy environment variables
ENV USE_PROXY false
EXPOSE $APP_PORT
# Run main.py when the container launches
CMD ["python", "src/main.py"]