
services:
  backend:
    build:
      context: .
      dockerfile: apps/server/Dockerfile
    container_name: gongxue_backend
    restart: always
    ports:
      - "127.0.0.1:3000:3000"
    environment:
      DB_TYPE: mysql
      DB_HOST: host.docker.internal
      DB_PORT: 3306
      DB_USERNAME: ${MYSQL_ROOT_USERNAME:-root}
      DB_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      DB_DATABASE: ${DB_DATABASE:-dorm_billing_v2}
      DB_SYNCHRONIZE: "false"
      JWT_SECRET: ${JWT_SECRET:-gongxue-jwt-prod-2026-k3y}
      JWT_EXPIRES_IN: 24h
      PORT: 3000

  frontend:
    build:
      context: .
      dockerfile: apps/admin/Dockerfile
    container_name: gongxue_frontend
    restart: always
    ports:
      - "127.0.0.1:9527:80"
    depends_on:
      - backend
