You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3 KiB

  1. version: "3.8"
  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: ./
  12. dockerfile: ./dockerfile_web
  13. container_name: gva-web
  14. restart: always
  15. ports:
  16. - '8000:8000'
  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: ./
  26. dockerfile: ./dockerfile_server
  27. container_name: gva-server
  28. restart: always
  29. ports:
  30. - '8888:8888'
  31. depends_on:
  32. - mysql
  33. - redis
  34. networks:
  35. network:
  36. ipv4_address: 177.7.0.12
  37. mysql:
  38. image: mysql:8.0.21
  39. container_name: gva-mysql
  40. command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
  41. restart: always
  42. ports:
  43. - "13306:3306" # host物理直接映射端口为13306
  44. environment:
  45. MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
  46. MYSQL_ROOT_PASSWORD: 'Aa@6447985' # root管理员用户密码
  47. networks:
  48. network:
  49. ipv4_address: 177.7.0.13
  50. redis:
  51. image: redis:6.0.6
  52. container_name: gva-redis # 容器名
  53. restart: always
  54. ports:
  55. - '6379:6379'
  56. networks:
  57. network:
  58. ipv4_address: 177.7.0.14