bookmark/docker-compose.yml

106 lines
3.1 KiB
YAML
Raw Normal View History

version: "2"
2019-12-13 23:47:47 +08:00
services:
2021-03-09 11:40:21 +08:00
mysql:
image: mysql:8.0.16
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-12-13 23:47:47 +08:00
volumes:
2021-03-09 11:40:21 +08:00
- ./data/mysql/data:/var/lib/mysql
2021-03-09 14:39:47 +08:00
# mysql文件备份目录
- ./data/mysql/backup:/backup
2021-03-09 11:40:21 +08:00
- ./data/mysql/temp:/var/lib/mysql-files
- ./data/mysql/my.cnf:/etc/mysql/my.cnf
- /etc/localtime:/etc/localtime
2021-03-09 11:40:21 +08:00
- ./data/timezone:/etc/timezone
2019-12-13 23:47:47 +08:00
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=bookmark
2021-03-14 23:36:30 +08:00
# redis未设置密码如端口暴露可能会被攻击
2021-03-09 11:40:21 +08:00
redis:
image: redis:3.2.10
2019-12-13 23:47:47 +08:00
volumes:
- /etc/localtime:/etc/localtime
2021-03-09 11:40:21 +08:00
- ./data/timezone:/etc/timezone
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2021-03-14 23:36:30 +08:00
2021-03-09 11:40:21 +08:00
front:
image: nginx
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-12-13 23:47:47 +08:00
volumes:
- /etc/localtime:/etc/localtime
2021-03-09 11:40:21 +08:00
- ./data/timezone:/etc/timezone
- ./bookmark_front/dist:/opt/dist
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./data/nginx/log:/var/log/nginx
- ${BOOKMARK_FILE_SAVE_PATH}/files/public:/opt/files/public
2019-12-13 23:47:47 +08:00
ports:
- 8083:8080
2021-03-14 23:36:30 +08:00
2021-03-09 11:40:21 +08:00
pinyin:
image: node:lts-buster-slim
2020-03-29 17:20:41 +08:00
networks:
- bookmark
volumes:
- /etc/localtime:/etc/localtime
2021-03-09 11:40:21 +08:00
- ./data/timezone:/etc/timezone
- ./pinyinService:/opt/app
2020-03-29 17:20:41 +08:00
working_dir: /opt/app
2021-03-14 23:36:30 +08:00
command:
2020-03-29 17:52:08 +08:00
- /bin/bash
- -c
- |
ls -l && \
cd /opt/app && \
npm --registry https://registry.npm.taobao.org install && \
node index.js 8012 123456321
2021-03-14 23:36:30 +08:00
# icon服务(默认端口8080)
iconserver:
image: matthiasluedtke/iconserver:latest
networks:
- bookmark
restart: unless-stopped
2021-03-09 11:40:21 +08:00
backend:
image: openjdk:11.0
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-12-13 23:47:47 +08:00
volumes:
- /etc/localtime:/etc/localtime
2021-03-09 11:40:21 +08:00
- ./data/timezone:/etc/timezone
- ./bookMarkService/web/target/bookmark-web-1.0-SNAPSHOT.jar:/opt/app/service.jar
- ${BOOKMARK_FILE_SAVE_PATH}:/opt/files
working_dir: /opt/app
2019-12-13 23:47:47 +08:00
command:
- /bin/bash
- -c
- |
sleep 20 && \
2019-07-16 05:10:43 -04:00
ls -l && \
java -jar -Dspring.profiles.active=prd \
2020-06-16 00:06:46 +08:00
-DjwtSecret='${JWT_SECRET}' \
2019-12-15 21:43:31 +08:00
-Dmybatis-plus.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl \
-Dspring.mail.host=${SMTP_HOST} \
2020-06-16 00:06:46 +08:00
-Dspring.mail.username='${SMTP_USERNAME}' \
-Dspring.mail.password='${SMTP_PASSWORD}' \
-Dspring.datasource.druid.password='${MYSQL_PASSWORD}' \
2021-03-09 11:40:21 +08:00
-Dspring.datasource.druid.url=jdbc:mysql://${MYSQL_ADDRESS}/bookmark?useUnicode=true\&characterEncoding=utf-8\&useSSL=false\&useJDBCCompliantTimezoneShift=true\&useLegacyDatetimeCode=false\&serverTimezone=UTC \
-Dspring.redis.host=${REDIS_HOST} \
2019-07-26 16:44:57 +08:00
-Des.host=bookmark-es \
-DserviceAddress=${BOOKMARK_HOST} \
-DfileSavePath=/opt/files \
2021-03-09 11:40:21 +08:00
-Dpinyin.base-url=http://pinyin:8012 \
2020-03-29 17:20:41 +08:00
-Dpinyin.token=123456321 \
2021-03-14 23:36:30 +08:00
-DurlIconAddress=http://iconserver:8080 \
-Dproxy.ip=${PROXY_IP} \
-Dproxy.port=${PROXY_PORT} \
-DOAuth.github.clientId=${GITHUB_CLIENT_ID} \
-DOAuth.github.secret=${GITHUB_SECRET} \
-DmanageUserId=${MANAGE_USER_ID} \
service.jar
2019-12-13 23:47:47 +08:00
networks:
2019-07-16 05:10:43 -04:00
bookmark: