Corrected the CMD command

This commit is contained in:
leehk 2025-04-14 16:28:39 +08:00
parent 3ee5ad91e0
commit 6c4f6f99c0
2 changed files with 7 additions and 4 deletions

View File

@ -77,5 +77,8 @@ RUN chown -R app:app $APP_HOME
# change to the app user
USER app
# run gunicorn
CMD pipenv run gunicorn --bind 0.0.0.0:$PORT backend.main:app -k uvicorn.workers.UvicornWorker
# expose the port the app runs on
EXPOSE 8765
# run uvicorn
CMD ["pipenv", "run", "uvicorn", "main:app", "--reload", "--workers", "1", "--host", "0.0.0.0", "--port", "8765"]

View File

@ -13,11 +13,11 @@ services:
dockerfile: Dockerfile.prod
container_name: backend
platform: linux/amd64
command: pipenv run uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 8000
# command: pipenv run uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 8765
volumes:
- ./backend:/usr/src/app
ports:
- "8000:8000"
- "8000:8765"
environment:
- ENVIRONMENT=dev
- TESTING=0