services:
  server:
    build:
      context: .
      dockerfile: Dockerfile
    expose:
      - '3001'
    environment:
      - DATABASE_URL
      - STRIPE_SECRET_KEY
      - STRIPE_WEBHOOK_SECRET
      - DOMAIN
      - PORT=3001
      - ADMIN_EMAIL
      - ADMIN_PASSWORD
      - COOKIE_SECRET
      - NODE_ENV=production
    volumes:
      - dist-data:/app/dist
    networks:
      - coolify
      - default
    restart: unless-stopped

  client:
    build:
      context: .
      dockerfile: docker/Dockerfile.client
    ports:
      - '80:80'
    volumes:
      - dist-data:/usr/share/nginx/html:ro
    depends_on:
      - server
    networks:
      - coolify
      - default
    restart: unless-stopped

volumes:
  dist-data:

networks:
  coolify:
    external: true
