docker-compose.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. version: "3"
  2. networks:
  3. network:
  4. ipam:
  5. driver: default
  6. config:
  7. - subnet: '177.7.0.0/16'
  8. services:
  9. web:
  10. build:
  11. context: ./web
  12. dockerfile: ./Dockerfile
  13. container_name: gva-web
  14. restart: always
  15. ports:
  16. - '8080:8080'
  17. depends_on:
  18. - server
  19. command: [ 'nginx-debug', '-g', 'daemon off;' ]
  20. networks:
  21. network:
  22. ipv4_address: 177.7.0.11
  23. server:
  24. build:
  25. context: ./server
  26. dockerfile: ./Dockerfile
  27. container_name: gva-server
  28. restart: always
  29. ports:
  30. - '8888:8888'
  31. depends_on:
  32. - mysql
  33. - redis
  34. links:
  35. - mysql
  36. - redis
  37. networks:
  38. network:
  39. ipv4_address: 177.7.0.12
  40. mysql:
  41. image: mysql:8.0.21
  42. container_name: gva-mysql
  43. command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
  44. restart: always
  45. ports:
  46. - "13306:3306" # host物理直接映射端口为13306
  47. environment:
  48. MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
  49. MYSQL_ROOT_PASSWORD: 'Aa@6447985' # root管理员用户密码
  50. networks:
  51. network:
  52. ipv4_address: 177.7.0.13
  53. redis:
  54. image: redis:6.0.6
  55. container_name: gva-redis # 容器名
  56. restart: always
  57. ports:
  58. - '16379:6379'
  59. networks:
  60. network:
  61. ipv4_address: 177.7.0.14