bookmark/bookMarkDocker/docker-compose.yml

119 lines
3.6 KiB
YAML
Raw Normal View History

version: "2"
2019-12-13 23:47:47 +08:00
services:
bookmark-mysql:
image: mysql:8.0.16
container_name: bookmark-mysql
2019-12-13 23:47:47 +08:00
ports:
- 3307:3306
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-12-13 23:47:47 +08:00
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
2019-12-13 23:47:47 +08:00
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=bookmark
bookmark-redis:
image: redis:3.2.10
container_name: bookmark-redis
2019-12-13 23:47:47 +08:00
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-07-16 17:00:27 +08:00
# redis未设置密码如端口暴露可能会被攻击
ports:
2019-12-13 23:47:47 +08:00
- 6380:6379
2019-07-19 15:13:45 +08:00
bookmark-es:
2020-01-25 18:09:39 +08:00
image: elasticsearch:7.2.0
2019-07-19 15:13:45 +08:00
container_name: bookmark-es
2019-12-13 23:47:47 +08:00
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
2019-07-19 15:13:45 +08:00
- ./es/data:/usr/share/elasticsearch/data
- ./es/ik:/usr/share/elasticsearch/plugins/ik
- ./es/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
environment:
2019-11-30 04:22:30 +00:00
- "ES_JAVA_OPTS=-Xms1500m -Xmx1500m"
2019-07-19 15:13:45 +08:00
ports:
- 9200:9200
- 9300:9300
2019-12-13 23:47:47 +08:00
networks:
2019-07-19 15:13:45 +08:00
- bookmark
bookmark-front:
image: nginx
container_name: bookmark-front
2019-07-16 05:10:43 -04:00
depends_on:
- bookmark-service
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-12-13 23:47:47 +08:00
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
2019-12-13 23:47:47 +08:00
ports:
- 8083:8080
2020-03-29 17:20:41 +08:00
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
2020-03-29 17:52:08 +08:00
command:
- /bin/bash
- -c
- |
ls -l && \
cd /opt/app && \
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
2019-12-13 23:47:47 +08:00
depends_on:
- bookmark-mysql
- bookmark-redis
2019-07-19 15:13:45 +08:00
- bookmark-es
2019-12-13 23:47:47 +08:00
networks:
- bookmark
2019-12-13 23:47:47 +08:00
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
2019-07-16 05:10:43 -04:00
- ../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 && \
2020-03-22 23:40:24 +08:00
java -jar -Dspring.profiles.actice=prd \
-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} \
-Dspring.mail.username=${SMTP_USERNAME} \
-Dspring.mail.password=${SMTP_PASSWORD} \
-Dspring.datasource.druid.password=${MYSQL_PASSWORD} \
2019-07-16 16:52:19 +08:00
-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 \
2019-07-26 16:44:57 +08:00
-Des.host=bookmark-es \
-DserviceAddress=${BOOKMARK_HOST} \
-DfileSavePath=/opt/files \
2019-12-13 23:47:47 +08:00
-DserviceAddress=https://bm.tapme.top \
2020-03-29 17:20:41 +08:00
-Dpinyin.base-url=http://bookmark-pinyin:8012 \
-Dpinyin.token=123456321 \
service.jar
2019-12-13 23:47:47 +08:00
networks:
2019-07-16 05:10:43 -04:00
bookmark: