version: '3'

networks:
  nocobase:
    driver: bridge

services:
  app:
    image: nocobase/nocobase:latest
    restart: always
    networks:
      - nocobase
    depends_on:
      - mysql
    environment:
      # The application's secret key, used to generate user tokens, etc.
      # If APP_KEY is changed, old tokens will also become invalid.
      # It can be any random string, and make sure it is not exposed.
      - APP_KEY=71ddbb8a84cbb816a069c549d48ba2e7a3a17cbf48478f239442a10628318f8
      # Database type, supports postgres, mysql, mariadb
      - DB_DIALECT=mysql
      # Database host, can be replaced with the IP of an existing database server
      - DB_HOST=mysql
      # Database port
      - DB_PORT=3306
      # Database name
      - DB_DATABASE=alcyonpartnet_estair_connect
      # Database user
      - DB_USER=alcyonpartnet_estair_connect
      # Database password
      - DB_PASSWORD=estair_connect@2025
      # Whether to convert table and field names to snake case
      - DB_UNDERSCORED=true
      # Timezone
      - TZ=UTC
      # Service platform username and password,
      # used for automatically downloading and updating plugins.
      - NOCOBASE_PKG_USERNAME=
      - NOCOBASE_PKG_PASSWORD=
    volumes:
      - ./storage:/app/nocobase/storage
    ports:
      - '13000:80'
    init: true

  # If using an existing database server, mysql service can be omitted
  mysql:
    image: mysql:8
    environment:
      MYSQL_DATABASE: alcyonpartnet_estair_connect
      MYSQL_USER: alcyonpartnet_estair_connect
      MYSQL_PASSWORD: estair_connect@2025
      MYSQL_ROOT_PASSWORD: estair_connect@2025
    restart: always
    volumes:
      - ./storage/db/mysql:/var/lib/mysql
    networks:
      - nocobase