@@ -29,23 +29,49 @@ git clone https://github.com/<you>/FastAPI-boilerplate
2929cd FastAPI-boilerplate
3030
3131# In the scripts/ folder, you can find scripts to run FastAPI-Boilerplate locally, with uvicorn workers, and in production with nginx.
32- # NOTE: For now, only local scripts are updated.
3332
34- # Running locally with Uvicorn:
33+ # Option 1: Running locally with Uvicorn
3534
3635# Copy Dockerfile and Docker Compose files:
3736cp scripts/local_with_uvicorn/Dockerfile Dockerfile
3837cp scripts/local_with_uvicorn/docker-compose.yml docker-compose.yml
3938
4039# Copy and create your environment file
4140cp scripts/local_with_uvicorn/env src/.env
42- # If you want, modify in the minimal environment variables as described in the docs.
41+ # If you want, modify the minimal environment variables as described in the docs.
4342
4443# Run everything using Docker:
4544docker compose up
4645
4746# Open the API documentation
4847open http://127.0.0.1:8000/docs
48+
49+ # Option 2: Running with Gunicorn managing Uvicorn workers
50+
51+ # Copy Dockerfile and Docker Compose files:
52+ cp scripts/gunicorn_managing_uvicorn_workers/Dockerfile Dockerfile
53+ cp scripts/gunicorn_managing_uvicorn_workers/docker-compose.yml docker-compose.yml
54+
55+ # Copy and create your environment file
56+ cp scripts/gunicorn_managing_uvicorn_workers/env src/.env
57+
58+ # Run everything using Docker:
59+ docker compose up
60+
61+ # Option 3: Production with NGINX
62+
63+ # Copy Dockerfile, Docker Compose, and nginx config:
64+ cp scripts/production_with_nginx/Dockerfile Dockerfile
65+ cp scripts/production_with_nginx/docker-compose.yml docker-compose.yml
66+ cp default.conf default.conf # nginx configuration (already in root)
67+
68+ # Copy and create your environment file
69+ cp scripts/production_with_nginx/env src/.env
70+
71+ # Run everything using Docker:
72+ docker compose up
73+
74+ # Access via http://localhost (nginx proxies to the app)
4975```
5076
5177> Full setup (from-scratch, .env examples, PostgreSQL & Redis, gunicorn, nginx) lives in the docs.
0 commit comments