f8606a45ff
Deploy to VPS / deploy (push) Has been cancelled
Two changes that together make Site Settings actually work end-to-end.
BRANDING ASSET SERVING (the broken thumbnails fix)
The favicon/logo previews were broken because uploaded files in
/public/branding had no path to reach the browser:
1. The folder wasn't mounted into the app container, so uploads
vanished on next deploy
2. Nginx had no location block, so /branding/foo.png returned 404
(everything not in cases/applications/news/parts/footage was a
proxy_pass to Next.js, which doesn't serve from /public/branding
in standalone mode)
Fix:
- docker-compose.yml: ./public/branding mounted to /app/public/branding
(write side) AND /srv/branding (read-only side for Nginx)
- nginx/conf.d/flux.conf: new "location /branding/" block, same
cache strategy as the other asset locations (max-age=300, must-revalidate)
FOOTER EMAIL + PHONE (David's request)
- siteSettingsTypes.ts: hqEmail and hqPhone fields added to FooterSettings,
pre-filled with sales@lethepowerflux.com and +39 0424 287 492
- Footer.tsx: clickable mailto: and tel: links with Mail / Phone icons
shown right under the HQ address. Hidden when fields are empty so the
layout stays clean for editors who want to suppress contact info.
- /hq-command/dashboard/settings: new "Headquarters contact" group in
the Footer tab with the two fields (auto-translate ignores them, since
emails and phone numbers don't need translation).
DEPLOY (David)
cd /opt/flux-srl
mkdir -p public/branding # one-time, creates the folder if missing
git pull
docker compose up -d --build app
docker compose exec nginx nginx -t
docker compose exec nginx nginx -s reload
104 lines
2.9 KiB
YAML
104 lines
2.9 KiB
YAML
# ═══════════════════════════════════════════════════════════════
|
|
# FLUX SRL — Docker Compose (Production)
|
|
# Services: PostgreSQL 16 + Next.js App + Nginx
|
|
# ═══════════════════════════════════════════════════════════════
|
|
|
|
services:
|
|
|
|
# ── PostgreSQL Database ──
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: always
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
POSTGRES_DB: ${DB_NAME}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
networks:
|
|
- flux-net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
command:
|
|
- postgres
|
|
- -c
|
|
- shared_buffers=256MB
|
|
- -c
|
|
- effective_cache_size=1GB
|
|
- -c
|
|
- work_mem=16MB
|
|
- -c
|
|
- maintenance_work_mem=128MB
|
|
- -c
|
|
- max_connections=50
|
|
- -c
|
|
- random_page_cost=1.1
|
|
|
|
# ── Next.js Application ──
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}?schema=public
|
|
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
|
SESSION_SECRET: ${SESSION_SECRET}
|
|
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
|
|
SMTP_HOST: ${SMTP_HOST}
|
|
SMTP_PORT: ${SMTP_PORT}
|
|
SMTP_USER: ${SMTP_USER}
|
|
SMTP_PASS: ${SMTP_PASS}
|
|
SMTP_FROM: ${SMTP_FROM}
|
|
SMTP_SECURE: ${SMTP_SECURE}
|
|
NODE_ENV: production
|
|
volumes:
|
|
- ./public/footage:/app/public/footage
|
|
- ./public/applications:/app/public/applications
|
|
- ./public/cases:/app/public/cases
|
|
- ./public/news:/app/public/news
|
|
- ./public/parts:/app/public/parts
|
|
- ./public/operations-inbox:/app/public/operations-inbox
|
|
- ./public/branding:/app/public/branding
|
|
networks:
|
|
- flux-net
|
|
expose:
|
|
- "3000"
|
|
|
|
# ── Nginx Reverse Proxy ──
|
|
nginx:
|
|
image: nginx:alpine
|
|
restart: always
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
|
- ./certbot/conf:/etc/letsencrypt:ro
|
|
- ./certbot/www:/var/www/certbot:ro
|
|
- ./public/cases:/srv/cases:ro
|
|
- ./public/applications:/srv/applications:ro
|
|
- ./public/news:/srv/news:ro
|
|
- ./public/parts:/srv/parts:ro
|
|
- ./public/footage:/srv/footage:ro
|
|
- ./public/operations-inbox:/srv/operations-inbox:ro
|
|
- ./public/branding:/srv/branding:ro
|
|
depends_on:
|
|
- app
|
|
networks:
|
|
- flux-net
|
|
|
|
volumes:
|
|
pgdata:
|
|
|
|
networks:
|
|
flux-net:
|
|
driver: bridge
|