71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
|
|
services:
|
||
|
|
traefik:
|
||
|
|
image: traefik:latest
|
||
|
|
container_name: colorfull-traefik
|
||
|
|
command:
|
||
|
|
- "--api.insecure=true"
|
||
|
|
- "--providers.docker=true"
|
||
|
|
- "--entrypoints.web.address=:80"
|
||
|
|
- "--entrypoints.websecure.address=:443"
|
||
|
|
ports:
|
||
|
|
- "80:80"
|
||
|
|
- "443:443"
|
||
|
|
volumes:
|
||
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
postgres:
|
||
|
|
build:
|
||
|
|
context: ./docker
|
||
|
|
dockerfile: Dockerfile.pgvector
|
||
|
|
container_name: colorfull-db
|
||
|
|
environment:
|
||
|
|
POSTGRES_DB: colorfull
|
||
|
|
POSTGRES_USER: colorfull
|
||
|
|
POSTGRES_PASSWORD: "${DB_PASSWORD:-colorfull}"
|
||
|
|
ports:
|
||
|
|
- "5432:5432"
|
||
|
|
volumes:
|
||
|
|
- pgdata:/var/lib/postgresql/data
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U colorfull -d colorfull"]
|
||
|
|
interval: 5s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
restart: unless-stopped
|
||
|
|
labels:
|
||
|
|
- "traefik.enable=false"
|
||
|
|
|
||
|
|
backend:
|
||
|
|
build: ./backend
|
||
|
|
container_name: colorfull-backend
|
||
|
|
environment:
|
||
|
|
NODE_ENV: production
|
||
|
|
PORT: 3001
|
||
|
|
DATABASE_URL: postgresql://colorfull:${DB_PASSWORD:-colorfull}@postgres:5432/colorfull
|
||
|
|
JWT_SECRET: "${JWT_SECRET}"
|
||
|
|
depends_on:
|
||
|
|
postgres:
|
||
|
|
condition: service_healthy
|
||
|
|
restart: unless-stopped
|
||
|
|
labels:
|
||
|
|
- "traefik.enable=true"
|
||
|
|
- "traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api`)"
|
||
|
|
- "traefik.http.services.backend.loadbalancer.server.port=3001"
|
||
|
|
- "traefik.http.services.backend.loadbalancer.healthcheck.path=/api/health/live"
|
||
|
|
- "traefik.http.services.backend.loadbalancer.healthcheck.interval=10s"
|
||
|
|
|
||
|
|
frontend:
|
||
|
|
build: ./frontend
|
||
|
|
container_name: colorfull-frontend
|
||
|
|
depends_on:
|
||
|
|
- backend
|
||
|
|
restart: unless-stopped
|
||
|
|
labels:
|
||
|
|
- "traefik.enable=true"
|
||
|
|
- "traefik.http.routers.frontend.rule=Host(`localhost`)"
|
||
|
|
- "traefik.http.services.frontend.loadbalancer.server.port=80"
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
pgdata:
|