version: "3" services: mysql: restart: always container_name: crowd_mysql image: "crowd-mysql:${DB_TAG}" volumes: - ${FILE_STORE_BASE_PATH}/${DB_STORE_DIR}:/var/lib/mysql ports: - 3308:3306 environment: - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_DATABASE=${MYSQL_DATABASE} redis: restart: always container_name: crowd_redis image: "crowd-redis:${REDIS_TAG}" depends_on: - mysql ports: - 6378:6379 # 后端 crowd_backend: restart: always container_name: crowd_backend image: "crowd-backend:${MAINSITE_BACKEND_TAG}" depends_on: - mysql - redis - crowd_user ports: - 8280:8080 volumes: - ${FILE_STORE_BASE_PATH}/${BACKEND_STORE_DIR}:/var/www 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 ##-Dhost需要根据实际地址修改 # 前端 crowd_frontend: restart: always container_name: crowd_frontend image: "crowd-frontend:${MAINSITE_FRONTEND_TAG}" depends_on: - crowd_backend ports: - 8200:80 volumes: - ${FILE_STORE_BASE_PATH}/${FRONTEND_STORE_DIR}:/var/www - ${FILE_STORE_BASE_PATH}/nginx:/etc/nginx # 用户服务 crowd_user: restart: always container_name: crowd_user image: "crowd-user:${MAINSITE_BACKEND_TAG}" depends_on: - mysql - redis ports: - 8281:8081 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 ##注意1:-Dhost需要根据实际地址修改 将172.16.100.98改成实际服务器的地址 ##注意2:nginx/sites-enabled/default中的server_name改成对应的实际地址 ##注意3:如果服务器已存在mysql和redis,或者端口被占用了,可以使用start-containers-multi-port.sh ##此文件启动访问:http://172.16.100.98:8200/ 将172.16.100.98改成实际服务器的地址