-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (26 loc) · 1012 Bytes
/
Dockerfile
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
36
# Use the official Python 3.11 image as the base image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV HTTP_KEEP_ALIVE 650
# Install system dependencies
RUN apt-get update \
&& apt-get install build-essential curl unzip -y --no-install-recommends gcc \
&& apt-get clean
# Set the working directory in the container
WORKDIR /app
# Copy only the necessary files for poetry installation
COPY pyproject.toml poetry.lock Makefile scripts/ /app/
# Install Poetry
RUN pip install poetry==1.5.1
# Install the application dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
# Copy the rest of the application code
COPY . /app
# Expose the port that Gunicorn will listen on
EXPOSE 5003
RUN make load-mock-unit-data
# Start Gunicorn to serve the application
CMD ["gunicorn", "app.main:app", "-b", "0.0.0.0:5003", "--worker-class", "uvicorn.workers.UvicornWorker", "--timeout", "0"]