docker-compose.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. version: '3.9'
  2. networks:
  3. basic:
  4. services:
  5. front:
  6. # build:
  7. # context: ./
  8. # dockerfile: ./docker/front/Dockerfile
  9. container_name: greaterwms_front
  10. image: greaterwms/greaterwms_front:latest
  11. restart: always
  12. ports:
  13. - '8080:8080'
  14. volumes:
  15. - ./templates:/GreaterWMS/templates:rw
  16. - ./web_start.sh:/GreaterWMS/templates/webstart.sh
  17. command:
  18. - /bin/bash
  19. - -c
  20. #- "yarn install --force"
  21. - |
  22. bash /GreaterWMS/templates/webstart.sh
  23. networks:
  24. - basic
  25. backend:
  26. # build:
  27. # context: ./
  28. # dockerfile: ./docker/backend/Dockerfile
  29. container_name: greaterwms_backend
  30. image: greaterwms/greaterwms_backend:latest
  31. restart: always
  32. volumes:
  33. - ./:/GreaterWMS/:rw #将前目录挂载到容器下
  34. - ./supervisord.conf:/etc/supervisor/supervisord.conf
  35. ports:
  36. - '8000:8000'
  37. environment:
  38. PYTHONUNBUFFERED: 1
  39. command:
  40. - /bin/bash
  41. - -c
  42. - |
  43. bash backend_start.sh && /etc/init.d/supervisor start
  44. networks:
  45. - basic
  46. # greaterwms-mysql:
  47. # image: mysql:5.7
  48. # container_name: greaterwms-mysql
  49. # #使用该参数,container内的root拥有真正的root权限,否则,container内的root只是外部的一个普通用户权限
  50. # #设置为true,不然数据卷可能挂载不了,启动不起
  51. # privileged: true
  52. # restart: always
  53. # ports:
  54. # - "3306:3306"
  55. # environment:
  56. # MYSQL_ROOT_PASSWORD: "GreaterWMS20210816"
  57. # MYSQL_DATABASE: "greaterwms"
  58. # TZ: Asia/Shanghai
  59. # command:
  60. # --wait_timeout=31536000
  61. # --interactive_timeout=31536000
  62. # --max_connections=1000
  63. # volumes:
  64. # #映射mysql的数据目录到宿主机,保存数据
  65. # - "./docker/mysql/data:/var/lib/mysql"
  66. # #根据宿主机下的配置文件创建容器
  67. # - "./docker/mysql/conf.d:/etc/mysql/conf.d"
  68. # - "./docker/mysql/logs:/logs"
  69. # networks:
  70. # - basic
  71. # nginx:
  72. # image: nginx:1.19.1
  73. # container_name: greaterwms_nginx
  74. # restart: always
  75. # privileged: true
  76. # environment:
  77. # - TZ=Asia/Shanghai
  78. # ports:
  79. # - 80:80
  80. # #- 443:443
  81. # volumes:
  82. # - /etc/localtime:/etc/localtime:ro
  83. # - ./nginx.conf:/etc/nginx/nginx.conf:ro
  84. # - ./static_new/:/GreaterWMS/static_new:ro
  85. # networks:
  86. # - basic