Replace the separate CMS subdomain with path-based routing in Caddy: /admin and /uploads go to Strapi, everything else to the frontend. Strapi 5 nests its whole admin panel (UI and API) under /admin, so this one prefix is enough and never collides with the frontend's own /api routes. Drops CMS_DOMAIN and the unused STRAPI_URL env var on the cms service; PUBLIC_STRAPI_URL now points at the same origin as the site. Authentication is unchanged: Strapi's own admin login still gates the panel, this only changes how it's reached.
29 lines
880 B
Bash
29 lines
880 B
Bash
# Copy to .env and replace every placeholder. Never commit .env.
|
|
|
|
# --- Domains (Caddy) ---
|
|
PUBLIC_DOMAIN=blog.localhost
|
|
ACME_EMAIL=admin@example.com
|
|
|
|
# --- Database ---
|
|
POSTGRES_DB=blog
|
|
POSTGRES_USER=blog
|
|
POSTGRES_PASSWORD=change-me
|
|
|
|
# --- Strapi ---
|
|
# Generate each secret with: openssl rand -base64 32
|
|
APP_KEYS=change-me-1,change-me-2
|
|
API_TOKEN_SALT=change-me
|
|
ADMIN_JWT_SECRET=change-me
|
|
TRANSFER_TOKEN_SALT=change-me
|
|
JWT_SECRET=change-me
|
|
ENCRYPTION_KEY=change-me
|
|
|
|
# --- Frontend ---
|
|
# Server-side only: internal Docker address of Strapi.
|
|
STRAPI_URL=http://cms:1337
|
|
# Public base URL of the website, used for canonical URLs and Open Graph.
|
|
PUBLIC_SITE_URL=https://blog.localhost
|
|
# Public base URL of Strapi, used to build absolute media URLs in the browser.
|
|
# Same origin as PUBLIC_SITE_URL: Caddy proxies /admin and /uploads to Strapi.
|
|
PUBLIC_STRAPI_URL=https://blog.localhost
|