version: '3.8' services: client: build: ./client # restart: always ports: - 3001:3001 environment: - SERVER_URL=http://backend:8089 # docker-compose需要用服务名 - CLIENT_PORT=3001 networks: - test-network backend: build: ./server # restart: always ports: - 8089 environment: - TZ=Asia/Shanghai - MYSQL_URL=jdbc:mysql://db:3306/test?serverTimezone=Asia/Shanghai - MYSQL_USERNAME=test - MYSQL_PASSWORD=test volumes: - ./server/static:/app/static depends_on: - db networks: - test-network db: image: mysql:5.7 # restart: always ports: - 3306 volumes: - ./mysql/data:/var/lib/mysql - ./mysql/init.sql:/init.sql environment: - MYSQL_ROOT_PASSWORD=root - TZ=Asia/Shanghai command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci networks: - test-network # fuzzscene: # build: ./FuzzScene # ports: # - 8090 # networks: # - test-network networks: test-network: