version: "3.9"
services:
  web:
    build:
      context: ..
      dockerfile: server/Dockerfile
    ports:
      - "3001:3001"
      - "3005:3005"
    environment:
      - DATABASE_USER=postgres
      - DATABASE_HOST=postgres
      - DATABASE_NAME=wavtool
      - DATABASE_PASSWORD=postgres
      - DATABASE_PORT=5432
      - ENVIRONMENT=development
      - GITHUB_CLIENT_ID=12345
      - GITHUB_CLIENT_SECRET=12345
      - GITHUB_REDIRECT_URI=https://wavtool.com/auth/github/callback
      - GOOGLE_CLIENT_ID=12345
      - GOOGLE_CLIENT_SECRET=12345
      - GOOGLE_REDIRECT_URI=https://wavtool.com/oauth2/redirect/google
      - FACEBOOK_APP_ID=1234
      - FACEBOOK_APP_SECRET=12345
      - FACEBOOK_REDIRECT_URI=https://wavtool.com/oauth2/redirect/facebook
      - OPENAI_API_KEY=secret-goes-here
      - SHUTDOWN_TIMEOUT=60
      - REDIS_URL=redis://redis
      - SESSION_PROVIDER=redis
  postgres:
    image: "postgres:15.2"
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - db:/var/lib/postgresql/data
  redis:
    image: "redis:7.0-alpine"
    ports:
      - "6379:6379"
    command: [ "redis-server", "--save", "10", "1", "--loglevel", "warning" ]
    volumes:
      - redis:/data
volumes:
  db:
    driver: local
  redis:
    driver: local
