production fixes
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: flockpal-postgres
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-flockpal}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-flockpal}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD for production}
|
||||
volumes:
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-flockpal} -d ${POSTGRES_DB:-flockpal}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: flockpal-backend
|
||||
environment:
|
||||
PORT: 5000
|
||||
NODE_ENV: production
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_DB: ${POSTGRES_DB:-flockpal}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-flockpal}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD for production}
|
||||
FRONTEND_URL: ${FRONTEND_URL:?set FRONTEND_URL for production}
|
||||
BACKEND_URL: ${BACKEND_URL:?set BACKEND_URL for production}
|
||||
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
|
||||
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
|
||||
MICROSOFT_CLIENT_ID: ${MICROSOFT_CLIENT_ID:-}
|
||||
MICROSOFT_CLIENT_SECRET: ${MICROSOFT_CLIENT_SECRET:-}
|
||||
APPLE_CLIENT_ID: ${APPLE_CLIENT_ID:-}
|
||||
APPLE_CLIENT_SECRET: ${APPLE_CLIENT_SECRET:-}
|
||||
SMTP_HOST: ${SMTP_HOST:-}
|
||||
SMTP_PORT: ${SMTP_PORT:-587}
|
||||
SMTP_SECURE: ${SMTP_SECURE:-false}
|
||||
SMTP_USER: ${SMTP_USER:-}
|
||||
SMTP_PASS: ${SMTP_PASS:-}
|
||||
SMTP_FROM_EMAIL: ${SMTP_FROM_EMAIL:-}
|
||||
SMTP_FROM_NAME: ${SMTP_FROM_NAME:-FlockPal}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=traefik
|
||||
- traefik.http.routers.flockpal-api.rule=Host(`${URL:?set URL for production}`) && PathPrefix(`/api`)
|
||||
- traefik.http.routers.flockpal-api.entrypoints=websecure
|
||||
- traefik.http.routers.flockpal-api.tls.certresolver=${TRAEFIK_CERTRESOLVER:-letsencrypt}
|
||||
- traefik.http.routers.flockpal-api.priority=100
|
||||
- traefik.http.services.flockpal-api.loadbalancer.server.port=5000
|
||||
networks:
|
||||
- default
|
||||
- traefik
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api}
|
||||
container_name: flockpal-frontend
|
||||
depends_on:
|
||||
- backend
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=traefik
|
||||
- traefik.http.routers.flockpal-web.rule=Host(`${URL:?set URL for production}`)
|
||||
- traefik.http.routers.flockpal-web.entrypoints=websecure
|
||||
- traefik.http.routers.flockpal-web.tls.certresolver=${TRAEFIK_CERTRESOLVER:-letsencrypt}
|
||||
- traefik.http.routers.flockpal-web.priority=10
|
||||
- traefik.http.services.flockpal-web.loadbalancer.server.port=80
|
||||
networks:
|
||||
- traefik
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
external: true
|
||||
Reference in New Issue
Block a user