forked from TaskingAI/TaskingAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (30 loc) · 940 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 a specific version for reproducibility
FROM python:3.10.12-slim
# Set environment variables
ENV PYTHONPATH=/code/ \
PYTHONIOENCODING=utf-8 \
API_RUN_ENV=docker \
TERM=xterm-256color \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /code
# Copy only the requirements.txt first to leverage Docker cache
COPY ./requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy code to working directory
COPY ./app ./app
COPY ./providers ./providers
COPY ./provider_dependency ./provider_dependency
COPY ./config.py ./
COPY ./test/utils/utils.py ./test/utils/utils.py
COPY ./scripts ./scripts
# Command to run the application using gunicorn
CMD gunicorn --bind 0.0.0.0:8000 \
--preload \
--access-logfile - \
--error-logfile - \
--worker-connections 200 \
-k uvicorn.workers.UvicornWorker \
app.fastapi_app:app
EXPOSE 8000