docker-compose.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. version: '3.8'
  2. services:
  3. client:
  4. build: ./client
  5. # restart: always
  6. ports:
  7. - 3001:3001
  8. environment:
  9. - SERVER_URL=http://backend:8089 # docker-compose需要用服务名
  10. - CLIENT_PORT=3001
  11. networks:
  12. - test-network
  13. backend:
  14. build: ./server
  15. # restart: always
  16. ports:
  17. - 8089
  18. environment:
  19. - TZ=Asia/Shanghai
  20. - MYSQL_URL=jdbc:mysql://db:3306/test?serverTimezone=Asia/Shanghai
  21. - MYSQL_USERNAME=test
  22. - MYSQL_PASSWORD=test
  23. volumes:
  24. - ./server/static:/app/static
  25. depends_on:
  26. - db
  27. networks:
  28. - test-network
  29. db:
  30. image: mysql:5.7
  31. # restart: always
  32. ports:
  33. - 3306
  34. volumes:
  35. - ./mysql/data:/var/lib/mysql
  36. - ./mysql/init.sql:/init.sql
  37. environment:
  38. - MYSQL_ROOT_PASSWORD=root
  39. - TZ=Asia/Shanghai
  40. command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
  41. networks:
  42. - test-network
  43. # fuzzscene:
  44. # build: ./FuzzScene
  45. # ports:
  46. # - 8090
  47. # networks:
  48. # - test-network
  49. networks:
  50. test-network: