mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 12:29:42 +00:00
♻️ Simplify environment defaults (#2415)
## AI Disclaimer Using Codex with gpt-5.6-sol. Reviewed manually.
This commit is contained in:
committed by
GitHub
parent
029e929253
commit
4632845a39
@@ -5,10 +5,6 @@ DOMAIN=localhost
|
||||
# To test the local Traefik config
|
||||
# DOMAIN=localhost.tiangolo.com
|
||||
|
||||
# Public frontend URL, used by the backend to generate links in emails.
|
||||
# Deployments derive this from DOMAIN in compose.deploy.yml.
|
||||
FRONTEND_HOST=http://localhost:5173
|
||||
|
||||
# Environment: local, staging, production
|
||||
ENVIRONMENT=local
|
||||
|
||||
@@ -31,7 +27,6 @@ SMTP_PORT=1025
|
||||
|
||||
# Postgres
|
||||
POSTGRES_SERVER=localhost
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_DB=app
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=changethis
|
||||
|
||||
@@ -88,15 +88,15 @@ services:
|
||||
depends_on:
|
||||
- backend
|
||||
- mailcatcher
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
|
||||
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
|
||||
- PLAYWRIGHT_BASE_URL=http://backend:8000
|
||||
- VITE_API_URL=http://backend:8000
|
||||
- MAILCATCHER_HOST=http://mailcatcher:1080
|
||||
# For the reports when run locally
|
||||
- PLAYWRIGHT_HTML_HOST=0.0.0.0
|
||||
- CI=${CI}
|
||||
- CI=${CI:-}
|
||||
volumes:
|
||||
- ./frontend/blob-report:/app/frontend/blob-report
|
||||
- ./frontend/test-results:/app/frontend/test-results
|
||||
|
||||
@@ -27,8 +27,6 @@ services:
|
||||
timeout: 10s
|
||||
volumes:
|
||||
- app-db-data:/var/lib/postgresql
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
|
||||
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
|
||||
@@ -59,7 +57,6 @@ services:
|
||||
condition: service_completed_successfully
|
||||
# The YAML anchor lets the prestart service reuse this environment mapping.
|
||||
environment: &backend-environment
|
||||
FRONTEND_HOST: ${FRONTEND_HOST?Variable not set}
|
||||
ENVIRONMENT: ${ENVIRONMENT}
|
||||
PROJECT_NAME: ${PROJECT_NAME?Variable not set}
|
||||
BACKEND_CORS_ORIGINS: ${BACKEND_CORS_ORIGINS}
|
||||
@@ -71,7 +68,6 @@ services:
|
||||
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
||||
EMAILS_FROM_EMAIL: ${EMAILS_FROM_EMAIL}
|
||||
POSTGRES_SERVER: db
|
||||
POSTGRES_PORT: ${POSTGRES_PORT}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER?Variable not set}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?Variable not set}
|
||||
|
||||
@@ -89,8 +89,6 @@ You can set several other environment variables:
|
||||
* `SMTP_USER`: The SMTP server user to send emails.
|
||||
* `SMTP_PASSWORD`: The SMTP server password to send emails.
|
||||
* `EMAILS_FROM_EMAIL`: The email account to send emails from.
|
||||
* `POSTGRES_SERVER`: The hostname of the PostgreSQL server. You can leave the default of `db`, provided by the same Docker Compose. You normally wouldn't need to change this unless you are using a third-party provider.
|
||||
* `POSTGRES_PORT`: The port of the PostgreSQL server. You can leave the default. You normally wouldn't need to change this unless you are using a third-party provider.
|
||||
* `POSTGRES_USER`: The Postgres user, you can leave the default.
|
||||
* `POSTGRES_DB`: The database name to use for this application. You can leave the default of `app`.
|
||||
* `SENTRY_DSN`: The DSN for Sentry, if you are using it.
|
||||
|
||||
Reference in New Issue
Block a user