Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ ENVIRONMENT=local

PROJECT_NAME="Full Stack FastAPI Project"

# Backend
# Additional allowed CORS origins, separated by commas
BACKEND_CORS_ORIGINS=
SECRET_KEY=changethis
FIRST_SUPERUSER=admin@example.com
FIRST_SUPERUSER_PASSWORD=changethis

# Emails
SMTP_HOST=localhost
SMTP_USER=
SMTP_PASSWORD=
EMAILS_FROM_EMAIL=info@example.com
SMTP_TLS=False
SMTP_PORT=1025
Expand All @@ -30,5 +25,3 @@ POSTGRES_SERVER=localhost
POSTGRES_DB=app
POSTGRES_USER=postgres
POSTGRES_PASSWORD=changethis

SENTRY_DSN=
1 change: 0 additions & 1 deletion .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
- self-hosted
- production
env:
ENVIRONMENT: production
DOMAIN: ${{ secrets.DOMAIN }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
FIRST_SUPERUSER: ${{ secrets.FIRST_SUPERUSER }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
- self-hosted
- staging
env:
ENVIRONMENT: staging
DOMAIN: ${{ secrets.DOMAIN }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
FIRST_SUPERUSER: ${{ secrets.FIRST_SUPERUSER }}
Expand Down
2 changes: 1 addition & 1 deletion backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Settings(BaseSettings):
# 60 minutes * 24 hours * 8 days = 8 days
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
FRONTEND_HOST: str = "http://localhost:5173"
ENVIRONMENT: Literal["local", "staging", "production"] = "local"
ENVIRONMENT: Literal["local"] | None = None

BACKEND_CORS_ORIGINS: Annotated[
list[AnyUrl] | str, BeforeValidator(parse_cors)
Expand Down
5 changes: 5 additions & 0 deletions compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ services:
volumes:
- ./backend/htmlcov:/app/backend/htmlcov
environment:
ENVIRONMENT: "local"
SMTP_HOST: "mailcatcher"
SMTP_PORT: "1025"
SMTP_TLS: "false"

prestart:
environment:
ENVIRONMENT: "local"

mailcatcher:
image: schickling/mailcatcher
ports:
Expand Down
9 changes: 4 additions & 5 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,20 @@ services:
condition: service_completed_successfully
# The YAML anchor lets the prestart service reuse this environment mapping.
environment: &backend-environment
ENVIRONMENT: ${ENVIRONMENT}
PROJECT_NAME: ${PROJECT_NAME?Variable not set}
BACKEND_CORS_ORIGINS: ${BACKEND_CORS_ORIGINS}
BACKEND_CORS_ORIGINS: ${BACKEND_CORS_ORIGINS:-}
SECRET_KEY: ${SECRET_KEY?Variable not set}
FIRST_SUPERUSER: ${FIRST_SUPERUSER?Variable not set}
FIRST_SUPERUSER_PASSWORD: ${FIRST_SUPERUSER_PASSWORD?Variable not set}
SMTP_HOST: ${SMTP_HOST}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
EMAILS_FROM_EMAIL: ${EMAILS_FROM_EMAIL}
POSTGRES_SERVER: db
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER?Variable not set}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?Variable not set}
SENTRY_DSN: ${SENTRY_DSN}
SENTRY_DSN: ${SENTRY_DSN:-}

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/utils/health-check/"]
Expand Down
6 changes: 0 additions & 6 deletions deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ Copy the content and use that as password / secret key. And run that again to ge

### Required Environment Variables

Set the `ENVIRONMENT`, by default `local` (for development), but when deploying to a server you would put something like `staging` or `production`:

```bash
export ENVIRONMENT=production
```

Set the `DOMAIN`, by default `localhost` (for development), but when deploying you would use your own domain, for example:

```bash
Expand Down