# 这个 compose 仅仅是一个参考,生产环境部署时,请根据实际情况调整参数 version: "3" services: db: image: mariadb:10.3 restart: always volumes: - "mysql-data:/var/lib/mysql" environment: - MYSQL_RANDOM_ROOT_PASSWORD=yes - MYSQL_DATABASE=dwsurvey - MYSQL_USER=dwsurvey - MYSQL_PASSWORD=dwsurvey dwsurvey: image: wkeyuan/dwsurvey:latest restart: always volumes: - "dwsurvey-wjHtml:/dwsurvey/WEB-INF/wjHtml" - "dwsurvey-site:/dwsurvey/WEB-INF/classes/conf/site" links: - db environment: - MYSQL_HOST=db - MYSQL_DATABASE=dwsurvey - MYSQL_USER=dwsurvey - MYSQL_PASSWORD=dwsurvey - ADMIN_EMAIL=admin@example.com - ADMIN_PASSWORD=123456 - CONTEXT_ROOT=/ ports: - "8080:8080" volumes: mysql-data: {} dwsurvey-wjHtml: {} dwsurvey-site: {}