2023-10-14 11:52:04 +00:00
|
|
|
# Use an official Python runtime as a parent image
|
2023-10-03 15:50:09 +00:00
|
|
|
FROM python:slim
|
2023-10-14 11:52:04 +00:00
|
|
|
|
|
|
|
# Set the working directory in the container to /app
|
2023-10-03 14:15:17 +00:00
|
|
|
WORKDIR /app
|
2023-10-03 15:29:56 +00:00
|
|
|
|
2023-10-14 11:52:04 +00:00
|
|
|
# Add metadata to the image to describe that the container is listening on port 80
|
2023-10-06 02:30:48 +00:00
|
|
|
EXPOSE 80
|
2023-10-14 11:52:04 +00:00
|
|
|
|
|
|
|
# Copy the current directory contents into the container at /app
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
# Install any needed packages specified in pyproject.toml
|
|
|
|
RUN apt-get update && apt-get install -y gcc curl && \
|
|
|
|
curl -sSL https://install.python-poetry.org | python - && \
|
2023-10-14 11:54:51 +00:00
|
|
|
echo "export PATH=$PATH:/root/.local/bin" >> ~/.bashrc && \
|
|
|
|
. ~/.bashrc && \
|
2023-10-14 11:52:04 +00:00
|
|
|
poetry config virtualenvs.create false && \
|
|
|
|
poetry install --no-dev
|
|
|
|
|
|
|
|
# Run server.py when the container launches
|
|
|
|
CMD ["python", "server.py"]
|