services:
  app:
    image: ghcr.io/oiov/wr.do/wrdo:${TAG:-latest}
    container_name: wrdo
    ports:
      - "3000:3000"
    environment:
      NODE_ENV: production
      DATABASE_URL: postgres://postgres:postgres@postgres:5432/wrdo
      AUTH_SECRET: ${AUTH_SECRET:-your-auth-secret}
      NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
      GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
      GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
      GITHUB_ID: ${GITHUB_ID}
      GITHUB_SECRET: ${GITHUB_SECRET}
      LinuxDo_CLIENT_ID: ${LinuxDo_CLIENT_ID}
      LinuxDo_CLIENT_SECRET: ${LinuxDo_CLIENT_SECRET}
      RESEND_API_KEY: ${RESEND_API_KEY}
      BREVO_API_KEY: ${BREVO_API_KEY}
      EMAIL_FROM: ${EMAIL_FROM}
      EMAIL_FROM_NAME: ${EMAIL_FROM_NAME}
      NEXT_PUBLIC_EMAIL_R2_DOMAIN: ${NEXT_PUBLIC_EMAIL_R2_DOMAIN}
      NEXT_PUBLIC_GOOGLE_ID: ${NEXT_PUBLIC_GOOGLE_ID}
      SCREENSHOTONE_BASE_URL: ${SCREENSHOTONE_BASE_URL}
      GITHUB_TOKEN: ${GITHUB_TOKEN}
      SKIP_DB_CHECK: ${SKIP_DB_CHECK}
      SKIP_DB_MIGRATION: ${SKIP_DB_MIGRATION}
    depends_on:
      - postgres
    networks:
      - wrdo-network
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    container_name: postgres
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=wrdo
    volumes:
      - postgres-data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - wrdo-network
    restart: unless-stopped

volumes:
  postgres-data:
    name: wrdo-postgres-data

networks:
  wrdo-network:
    driver: bridge
