feature:添加DB,REDIS,ES Docker到docker-compose中,实现自动启动第三方服务

pull/12/head
chenwen@trusfort.com 2 years ago
parent 8820b59297
commit 60aa953897

@ -1,17 +1,83 @@
version: '3'
x-public-common: &public-config
environment:
MYSQL_HOST: 192.168.56.107 # 配置数据库的信息
MYSQL_HOST: eiam-db # 配置数据库的信息
MYSQL_USER: root
MYSQL_PASSWORD: admin
ES_HOST: 192.168.56.107 # 配置ES信息
REDIS_HOST: 192.168.56.107 # 配置REDIS的信息
REDIS_PASSWORD: 12345678
CONSOLE_PUBLIC_BASE_URL: http://192.168.56.104:1898
PORTAL_PUBLIC_BASE_URL: https://192.168.56.104:1989
OPENAPI_PUBLIC_BASE_URL: http://192.168.56.104:1988
SYNCHRONIZER_PUBLIC_BASE_URL: http://192.168.56.104:1986
MYSQL_PASSWORD: topiam
ES_HOST: eiam-es # 配置ES信息
REDIS_HOST: eiam-redis # 配置REDIS的信息
REDIS_PASSWORD: topiam
CONSOLE_PUBLIC_BASE_URL: http://localhost:1898
PORTAL_PUBLIC_BASE_URL: https://localhost:1989
OPENAPI_PUBLIC_BASE_URL: http://localhost:1988
SYNCHRONIZER_PUBLIC_BASE_URL: http://localhost:1986
services:
eiam-es:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.16
container_name: "eiam-es"
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- "9200:9200"
- "9300:9300"
healthcheck:
test: [ "CMD", "curl" , "-f", "http://localhost:9200/_cat/health?v" ]
timeout: 20s
retries: 10
volumes:
- eiam_es_data:/usr/share/elasticsearch/data
networks:
- eiam-network
eiam-db:
image: mysql:8.0
container_name: "eiam-db"
environment:
- MYSQL_ROOT_PASSWORD=topiam
- MYSQL_DATABASE=eiam_develop
healthcheck:
test: [ "CMD", "mysqladmin" , "-ptopiam", "-hlocalhost","ping"]
timeout: 20s
retries: 10
ports:
- "3306:3306"
volumes:
- eiam_db_data:/var/lib/mysql
networks:
- eiam-network
eiam-db-admin:
container_name: "eiam-db-admin"
image: phpmyadmin:latest
ports:
- "7080:80"
environment:
- PMA_HOST=eiam-db
- UPLOAD_LIMIT=512M
healthcheck:
test: [ "CMD", "curl" , "-f", "http://localhost" ]
timeout: 20s
retries: 10
depends_on:
eiam-db:
condition: service_healthy
networks:
- eiam-network
eiam-redis:
image: redis:7.0
container_name: "eiam-redis"
command: redis-server --requirepass topiam
healthcheck:
test: [ "CMD", "redis-cli" ,"ping" ]
timeout: 20s
retries: 10
ports:
- "6379:6379"
networks:
- eiam-network
eiam-console:
build:
context: .
@ -22,6 +88,15 @@ services:
- 1898:1898
image: eiam-console
restart: always
depends_on:
eiam-es:
condition: service_healthy
eiam-db:
condition: service_healthy
eiam-redis:
condition: service_healthy
eiam-db-admin:
condition: service_healthy
networks:
- eiam-network
eiam-openapi:
@ -34,6 +109,13 @@ services:
restart: always
ports:
- 1988:1988
depends_on:
eiam-es:
condition: service_healthy
eiam-db:
condition: service_healthy
eiam-redis:
condition: service_healthy
networks:
- eiam-network
eiam-portal:
@ -46,6 +128,13 @@ services:
restart: always
ports:
- 1989:1989
depends_on:
eiam-es:
condition: service_healthy
eiam-db:
condition: service_healthy
eiam-redis:
condition: service_healthy
networks:
- eiam-network
eiam-synchronizer:
@ -58,9 +147,19 @@ services:
restart: always
ports:
- 1986:1986
depends_on:
eiam-es:
condition: service_healthy
eiam-db:
condition: service_healthy
eiam-redis:
condition: service_healthy
networks:
- eiam-network
networks:
eiam-network:
external: false
name: eiam-network
volumes:
eiam_es_data:
eiam_db_data:

Loading…
Cancel
Save