Skip to content

Commit

Permalink
Use multiple workers in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Jan 16, 2024
1 parent 26de473 commit 28f6103
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ RUN mkdir -p src/weights \

FROM base as dev
COPY tests/ tests/
CMD ["uvicorn", "src.main:app", "--reload", "--host", "0.0.0.0", "--port", "5000", "--no-server-header"]

FROM base as prod
RUN pip install --extra-index-url https://download.pytorch.org/whl/cpu \
torch==2.1.1+cpu torchvision==0.16.1+cpu && rm -r /root/.cache
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "5000", "--no-server-header"]
torch==2.1.1+cpu torchvision==0.16.1+cpu && rm -r /root/.cache
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
fastapi==0.103.2
httpx>=0.25.0
uvicorn==0.23.2
gunicorn==21.2.0
python-multipart>=0.0.6
gelf-formatter==0.2.1
pyyaml>=5.4.1
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- CACERT_LOCATION
context: ./backend
target: ${BUILD_TARGET:-dev}
command: uvicorn src.main:app --reload --host 0.0.0.0 --port 5000 --no-server-header
container_name: basegun-backend
environment:
- S3_URL_ENDPOINT=http://minio:9000
Expand Down

0 comments on commit 28f6103

Please sign in to comment.