Skip to content

Commit

Permalink
Add CMD instruction to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosribas committed May 8, 2024
1 parent db5b64f commit 4512a77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ RUN pip install --no-cache-dir -r requirements.txt
# copy project
COPY . .

EXPOSE 8000
# run the FastAPI app
CMD [ "gunicorn", "-c", "gunicorn/gunicorn_conf.py", "-b", "0.0.0.0:8000", "main:app"]
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ services:
# FastAPI
web:
build: .
command: gunicorn -c gunicorn/gunicorn_conf.py -b 0.0.0.0:8000 main:app
ports:
- "8000:8000"
expose:
- 8000
networks:
- nginx-network

# Nginx server
nginx:
image: nginx:1.26.0-alpine
ports:
- 80:80
- 8000:80
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
depends_on:
Expand Down

0 comments on commit 4512a77

Please sign in to comment.