105 lines
3.2 KiB
YAML
105 lines
3.2 KiB
YAML
version: "2"
|
||
services:
|
||
mysql:
|
||
image: mysql:8.0.16
|
||
networks:
|
||
- bookmark
|
||
volumes:
|
||
- ./data/mysql/data:/var/lib/mysql
|
||
# mysql文件备份目录
|
||
- ./data/mysql/backup:/backup
|
||
- ./data/mysql/temp:/var/lib/mysql-files
|
||
- ./data/mysql/my.cnf:/etc/mysql/my.cnf
|
||
- /etc/localtime:/etc/localtime
|
||
- ./data/timezone:/etc/timezone
|
||
environment:
|
||
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
|
||
- MYSQL_DATABASE=bookmark
|
||
redis:
|
||
image: redis:3.2.10
|
||
volumes:
|
||
- /etc/localtime:/etc/localtime
|
||
- ./data/timezone:/etc/timezone
|
||
networks:
|
||
- bookmark
|
||
# redis未设置密码,如端口暴露可能会被攻击
|
||
# bookmark-es:
|
||
# image: elasticsearch:7.2.0
|
||
# container_name: bookmark-es
|
||
# volumes:
|
||
# - /etc/localtime:/etc/localtime
|
||
# - ./timezone:/etc/timezone
|
||
# - ./es/data:/usr/share/elasticsearch/data
|
||
# - ./es/ik:/usr/share/elasticsearch/plugins/ik
|
||
# - ./es/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
|
||
# environment:
|
||
# - "ES_JAVA_OPTS=-Xms1500m -Xmx1500m"
|
||
# ports:
|
||
# - 9200:9200
|
||
# - 9300:9300
|
||
# networks:
|
||
# - bookmark
|
||
front:
|
||
image: nginx
|
||
networks:
|
||
- bookmark
|
||
volumes:
|
||
- /etc/localtime:/etc/localtime
|
||
- ./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
|
||
ports:
|
||
- 8083:8080
|
||
pinyin:
|
||
image: node:lts-buster-slim
|
||
networks:
|
||
- bookmark
|
||
volumes:
|
||
- /etc/localtime:/etc/localtime
|
||
- ./data/timezone:/etc/timezone
|
||
- ./pinyinService:/opt/app
|
||
working_dir: /opt/app
|
||
command:
|
||
- /bin/bash
|
||
- -c
|
||
- |
|
||
ls -l && \
|
||
cd /opt/app && \
|
||
npm --registry https://registry.npm.taobao.org install && \
|
||
node index.js 8012 123456321
|
||
backend:
|
||
image: openjdk:11.0
|
||
networks:
|
||
- bookmark
|
||
volumes:
|
||
- /etc/localtime:/etc/localtime
|
||
- ./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
|
||
command:
|
||
- /bin/bash
|
||
- -c
|
||
- |
|
||
sleep 20 && \
|
||
ls -l && \
|
||
java -jar -Dspring.profiles.active=prd \
|
||
-DjwtSecret='${JWT_SECRET}' \
|
||
-Dmybatis-plus.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl \
|
||
-Dspring.mail.host=${SMTP_HOST} \
|
||
-Dspring.mail.username='${SMTP_USERNAME}' \
|
||
-Dspring.mail.password='${SMTP_PASSWORD}' \
|
||
-Dspring.datasource.druid.password='${MYSQL_PASSWORD}' \
|
||
-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} \
|
||
-Des.host=bookmark-es \
|
||
-DserviceAddress=${BOOKMARK_HOST} \
|
||
-DfileSavePath=/opt/files \
|
||
-Dpinyin.base-url=http://pinyin:8012 \
|
||
-Dpinyin.token=123456321 \
|
||
service.jar
|
||
networks:
|
||
bookmark:
|