services:
  db:
    image: postgres:16-alpine
    container_name: workparking-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: workparking
      POSTGRES_USER: workparking
      POSTGRES_PASSWORD: change_me_strong_password
    ports:
      - "127.0.0.1:5432:5432"
    volumes:
      - workparking_pgdata:/var/lib/postgresql/data

  workparking:
    build:
      context: .
      args:
        DATABASE_URL: postgresql://workparking:change_me_strong_password@db:5432/workparking?schema=public
    container_name: workparking
    restart: unless-stopped
    environment:
      NODE_ENV: production
      PORT: 3000
      HOSTNAME: 0.0.0.0
      DATABASE_URL: postgresql://workparking:change_me_strong_password@db:5432/workparking?schema=public
      ADMIN_EMAIL: admin@workparking.ru
      ADMIN_PASSWORD: "vvEzQxqXzgjS-9oT"
      ADMIN_SESSION_SECRET: "d9yyLuMk7xdNqNv2vxEXQzGHSc_ZcAM49NFfUKZJrFysyZ3Yb2"
      CRM_HOST: crm.workparking.ru
    ports:
      - "127.0.0.1:3011:3000"
    depends_on:
      - db

volumes:
  workparking_pgdata: