bookmark/bookMarkDocker/docker-compose.yml
2020-03-29 17:20:41 +08:00

112 lines
3.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: "2"
services:
bookmark-mysql:
image: mysql:8.0.16
container_name: bookmark-mysql
ports:
- 3307:3306
networks:
- bookmark
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/temp:/var/lib/mysql-files
- ./mysql/my.cnf:/etc/mysql/my.cnf
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=bookmark
bookmark-redis:
image: redis:3.2.10
container_name: bookmark-redis
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
networks:
- bookmark
# redis未设置密码如端口暴露可能会被攻击
ports:
- 6380:6379
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
bookmark-front:
image: nginx
container_name: bookmark-front
depends_on:
- bookmark-service
networks:
- bookmark
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
- ../front/build:/opt/dist
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/log:/var/log/nginx
- ${BOOKMARK_FILE_SAVE_PATH}/files/public:/opt/files/public
ports:
- 8083:8080
bookmark-pinyin:
image: registry.cn-hangzhou.aliyuncs.com/fleyx/node-java-env:v2
container_name: bookmark-pinyin
networks:
- bookmark
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
- ../pinyinService:/opt/app
working_dir: /opt/app
command: npm --registry https://registry.npm.taobao.org install && node index.js 8012 123456321
bookmark-service:
image: registry.cn-hangzhou.aliyuncs.com/fleyx/node-java-env:v2
container_name: bookmark-service
depends_on:
- bookmark-mysql
- bookmark-redis
- bookmark-es
networks:
- bookmark
volumes:
- /etc/localtime:/etc/localtime
- ./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.actice=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://bookmark-mysql:3306/bookmark?useUnicode=true\&characterEncoding=utf-8\&useSSL=false\&useJDBCCompliantTimezoneShift=true\&useLegacyDatetimeCode=false\&serverTimezone=UTC \
-Dspring.redis.host=bookmark-redis \
-Des.host=bookmark-es \
-DserviceAddress=${BOOKMARK_HOST} \
-DfileSavePath=/opt/files \
-DserviceAddress=https://bm.tapme.top \
-Dpinyin.base-url=http://bookmark-pinyin:8012 \
-Dpinyin.token=123456321 \
service.jar
networks:
bookmark: