Files
blog/docker-compose.yml
T
davide c08f53ca69 Add a language switcher with English, Italian, Spanish and French
The interface is translated through @nuxtjs/i18n: strings live in
i18n/locales/*.json, routes are prefixed except for the default English, and
useLocaleHead emits the lang attribute, the hreflang alternates and og:locale.

The switcher is a native select rather than a custom dropdown: keyboard
support, the platform picker on mobile and correct labelling come for free.

Article content stays single-language — this translates the site chrome only.
2026-08-25 14:23:09 +02:00

81 lines
2.0 KiB
YAML

services:
database:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
cms:
build: ./cms
restart: unless-stopped
depends_on:
database:
condition: service_healthy
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 1337
DATABASE_CLIENT: postgres
DATABASE_HOST: database
DATABASE_PORT: 5432
DATABASE_NAME: ${POSTGRES_DB}
DATABASE_USERNAME: ${POSTGRES_USER}
DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
APP_KEYS: ${APP_KEYS}
API_TOKEN_SALT: ${API_TOKEN_SALT}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT}
JWT_SECRET: ${JWT_SECRET}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
STRAPI_URL: https://${CMS_DOMAIN}
volumes:
- cms-uploads:/app/public/uploads
frontend:
build: ./frontend
restart: unless-stopped
depends_on:
- cms
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
NUXT_STRAPI_URL: ${STRAPI_URL}
NUXT_PUBLIC_SITE_URL: ${PUBLIC_SITE_URL}
NUXT_PUBLIC_STRAPI_URL: ${PUBLIC_STRAPI_URL}
# Absolute origin for the alternate-language links.
NUXT_PUBLIC_I18N_BASE_URL: ${PUBLIC_SITE_URL}
caddy:
image: caddy:2-alpine
restart: unless-stopped
depends_on:
- frontend
- cms
ports:
- "80:80"
- "443:443"
environment:
PUBLIC_DOMAIN: ${PUBLIC_DOMAIN}
CMS_DOMAIN: ${CMS_DOMAIN}
ACME_EMAIL: ${ACME_EMAIL}
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-data:/data
- caddy-config:/config
volumes:
postgres-data:
cms-uploads:
caddy-data:
caddy-config: