bookmark/bookMarkDocker/docker-compose.yml

93 lines
2.7 KiB
YAML
Raw Normal View History

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:
2019-07-16 05:10:43 -04:00
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=bookmark
bookmark-redis:
image: redis:3.2.10
container_name: bookmark-redis
volumes:
- /etc/localtime:/etc/localtime
- ./timezone:/etc/timezone
networks:
- bookmark
2019-07-16 17:00:27 +08:00
# redis未设置密码如端口暴露可能会被攻击
ports:
2019-07-16 17:00:27 +08:00
- 6380:6379
2019-07-19 15:13:45 +08:00
bookmark-es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
container_name: bookmark-es
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
2019-07-19 15:13:45 +08:00
ports:
- 9200:9200
- 9300:9300
networks:
- bookmark
bookmark-front:
image: nginx
container_name: bookmark-front
2019-07-16 05:10:43 -04:00
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
ports:
- 8083:8080
bookmark-service:
image: registry.cn-hangzhou.aliyuncs.com/fleyx/node-java-env:v1
container_name: bookmark-service
depends_on:
- bookmark-mysql
- bookmark-redis
2019-07-19 15:13:45 +08:00
- bookmark-es
networks:
- bookmark
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
working_dir: /opt/app
command:
- /bin/bash
- -c
- |
sleep 20 && \
2019-07-16 05:10:43 -04:00
ls -l && \
java -jar -DisDev=false \
2019-07-16 05:10:43 -04:00
-DjwtSecret=123456 \
-Dmybatis.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl \
-Dspring.mail.host= \
-Dspring.mail.username= \
-Dspring.mail.password= \
-Dspring.mail.port= \
2019-07-16 05:10:43 -04:00
-Dspring.datasource.druid.password=123456 \
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 \
service.jar
networks:
2019-07-16 05:10:43 -04:00
bookmark: