version: '3'

services:
  api:
    container_name: moneynote_api
    image: registry.cn-hangzhou.aliyuncs.com/moneynote/moneynote-api:latest
    restart: always
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      - DB_HOST=${DB_HOST:-host.docker.internal}
      - DB_PORT=${DB_PORT:-3306}
      - DB_NAME=${DB_NAME:-moneynote}
      - DB_USER=${DB_USER:-root}
      - DB_PASSWORD=${DB_PASSWORD:-78p7gkc1}
      - invite_code=${invite_code:-111111}
    ports:
      - "43742:9092"

  pc:
    container_name: moneynote_pc
    links:
      - api
    image: registry.cn-hangzhou.aliyuncs.com/moneynote/moneynote-pc:latest
    restart: always
    environment:
      USER_API_HOST: http://api:9092
    ports:
      - "43743:80"

  h5:
    container_name: moneynote_h5
    links:
      - api
    image: registry.cn-hangzhou.aliyuncs.com/moneynote/moneynote-h5:latest
    restart: always
    environment:
      USER_API_HOST: http://api:9092
    ports:
      - "43744:80"