-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1023 Bytes
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1023 Bytes
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 an official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
# Don't write byte code files to disk
ENV PYTHONDONTWRITEBYTECODE 1
# Unbuffered output for easier container logging
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /app
# Install dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY .. /app
## Copy the entrypoint script into the container
#COPY entrypoint.sh /usr/local/bin/
#
## Make sure the script is executable
#RUN chmod +x /usr/local/bin/entrypoint.sh
#
#ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
## Command to run the application
#CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
## Run the container with multiple workers instead if needed.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "2"]