docker-compose-multi-local.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. version: "3"
  2. services:
  3. mysql:
  4. restart: always
  5. container_name: crowd_mysql
  6. image: "crowd-mysql:${DB_TAG}"
  7. volumes:
  8. - ${FILE_STORE_BASE_PATH}/${DB_STORE_DIR}:/var/lib/mysql
  9. ports:
  10. - 3308:3306
  11. environment:
  12. - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
  13. - MYSQL_DATABASE=${MYSQL_DATABASE}
  14. redis:
  15. restart: always
  16. container_name: crowd_redis
  17. image: "crowd-redis:${REDIS_TAG}"
  18. depends_on:
  19. - mysql
  20. ports:
  21. - 6378:6379
  22. # 后端
  23. crowd_backend:
  24. restart: always
  25. container_name: crowd_backend
  26. image: "crowd-backend:${MAINSITE_BACKEND_TAG}"
  27. depends_on:
  28. - mysql
  29. - redis
  30. - crowd_user
  31. ports:
  32. - 8280:8080
  33. volumes:
  34. - ${FILE_STORE_BASE_PATH}/${BACKEND_STORE_DIR}:/var/www
  35. command: java -jar --spring.profiles.active=private-cloud --file.save.path=/var/www/ --host=http://172.16.100.98 --website.domainName=172.16.100.98 --baseUrl.service.review=http://172.16.100.98:9004 --baseUrl.service.crowd=http://172.16.100.98:8091 --baseUrl.service.crowdIndex=http://172.16.100.98:81/edit?primaryColor=%231890ff&fixSiderbar=true&colorWeak=false&title=%E4%BC%97%E6%B5%8B%E6%9C%8D%E5%8A%A1%E7%B3%BB%E7%BB%9F&pwa=false&token= site-0.0.1-SNAPSHOT.jar > nohub.out
  36. ##-Dhost需要根据实际地址修改
  37. # 前端
  38. crowd_frontend:
  39. restart: always
  40. container_name: crowd_frontend
  41. image: "crowd-frontend:${MAINSITE_FRONTEND_TAG}"
  42. depends_on:
  43. - crowd_backend
  44. ports:
  45. - 8200:80
  46. volumes:
  47. - ${FILE_STORE_BASE_PATH}/${FRONTEND_STORE_DIR}:/var/www
  48. - ${FILE_STORE_BASE_PATH}/nginx:/etc/nginx
  49. # 用户服务
  50. crowd_user:
  51. restart: always
  52. container_name: crowd_user
  53. image: "crowd-user:${MAINSITE_BACKEND_TAG}"
  54. depends_on:
  55. - mysql
  56. - redis
  57. ports:
  58. - 8281:8081
  59. command: java -jar --spring.profiles.active=private-cloud --host=http://172.16.100.98:8200 --redirect.url=http://172.16.100.98:8200 --default.goto=http://172.16.100.98:8200 --default.login=http://172.16.100.98:8281/page/login --website.domainName=172.16.100.98 mooctest-user-server.jar > nohub.out
  60. ##注意1:-Dhost需要根据实际地址修改 将172.16.100.98改成实际服务器的地址
  61. ##注意2:nginx/sites-enabled/default中的server_name改成对应的实际地址
  62. ##注意3:如果服务器已存在mysql和redis,或者端口被占用了,可以使用start-containers-multi-port.sh
  63. ##此文件启动访问:http://172.16.100.98:8200/ 将172.16.100.98改成实际服务器的地址