tianyuan-api-server/docker-compose.yml

187 lines
3.7 KiB
YAML
Raw Normal View History

2024-10-02 00:57:17 +08:00
version: '3'
services:
2024-10-02 11:27:51 +08:00
tyapi_etcd:
2024-10-02 00:57:17 +08:00
image: bitnami/etcd
2024-10-02 11:27:51 +08:00
container_name: tyapi_etcd
2024-10-02 00:57:17 +08:00
environment:
2024-10-02 02:31:36 +08:00
- TZ=Asia/Shanghai
2024-10-02 00:57:17 +08:00
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_ADVERTISE_CLIENT_URLS=http://tyapi_etcd:2379
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
2024-10-02 11:27:51 +08:00
networks:
- tyapi_network
2024-10-02 00:57:17 +08:00
restart: always
2024-10-02 11:27:51 +08:00
tyapi_etcdManage:
2024-10-02 00:57:17 +08:00
image: evildecay/etcdkeeper
2024-10-02 11:27:51 +08:00
container_name: tyapi_etcdManage
2024-10-02 00:57:17 +08:00
environment:
2024-10-02 02:31:36 +08:00
- TZ=Asia/Shanghai
2024-10-02 00:57:17 +08:00
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_etcd
networks:
- tyapi_network
2024-10-02 00:57:17 +08:00
restart: always
2024-10-02 11:27:51 +08:00
tyapi_zookeeper:
2024-10-02 00:57:17 +08:00
image: wurstmeister/zookeeper
2024-10-02 11:27:51 +08:00
container_name: tyapi_zookeeper
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_kafka:
2024-10-02 00:57:17 +08:00
image: wurstmeister/kafka
2024-10-02 11:27:51 +08:00
container_name: tyapi_kafka
2024-10-02 00:57:17 +08:00
environment:
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
2024-10-02 11:27:51 +08:00
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://tyapi_kafka:9092
KAFKA_ZOOKEEPER_CONNECT: tyapi_zookeeper:2181
2024-10-02 00:57:17 +08:00
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2024-10-02 11:27:51 +08:00
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_redis:
2024-10-02 00:57:17 +08:00
image: redis:7.4.0
2024-10-02 11:27:51 +08:00
container_name: tyapi_redis
2024-10-02 00:57:17 +08:00
ports:
2024-10-02 11:27:51 +08:00
- "11002:6379"
networks:
- tyapi_network
2024-10-02 00:57:17 +08:00
restart: always
2024-10-02 11:27:51 +08:00
tyapi_mysql:
2024-10-02 00:57:17 +08:00
image: mysql:8.0.34
2024-10-02 11:27:51 +08:00
container_name: tyapi_mysql
2024-10-02 00:57:17 +08:00
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_DATABASE=tianyuanapi
- MYSQL_USER=tianyuanapi
- MYSQL_PASSWORD=g3h98u0291j
ports:
2024-10-02 11:27:51 +08:00
- "11001:3306"
2024-10-02 00:57:17 +08:00
volumes:
- mysql_data:/var/lib/mysql
2024-10-02 11:27:51 +08:00
networks:
- tyapi_network
- 1panel-network
2024-10-02 00:57:17 +08:00
restart: always
2024-10-02 11:27:51 +08:00
tyapi_gateway:
container_name: tyapi_gateway
2024-10-02 00:57:17 +08:00
build:
2024-10-02 02:27:36 +08:00
context: .
dockerfile: ./apps/gateway/Dockerfile
2024-10-02 00:57:17 +08:00
ports:
- "10001:10001"
environment:
- ENV=production
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_etcd
- tyapi_redis
- tyapi_mysql
- tyapi_user
- tyapi_sentinel
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_admin:
container_name: tyapi_admin
2024-10-02 00:57:17 +08:00
build:
2024-10-02 02:27:36 +08:00
context: .
dockerfile: ./apps/admin/Dockerfile
2024-10-02 00:57:17 +08:00
ports:
- "10002:10002"
environment:
- ENV=production
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_etcd
- tyapi_redis
- tyapi_mysql
- tyapi_user
- tyapi_sentinel
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_api:
container_name: tyapi_api
2024-10-02 00:57:17 +08:00
build:
2024-10-02 02:27:36 +08:00
context: .
dockerfile: ./apps/api/Dockerfile
2024-10-02 00:57:17 +08:00
ports:
- "10003:10003"
environment:
- ENV=production
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_etcd
- tyapi_redis
- tyapi_mysql
- tyapi_user
- tyapi_sentinel
- tyapi_mqs
- tyapi_kafka
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_mqs:
container_name: tyapi_mqs
2024-10-02 00:57:17 +08:00
build:
2024-10-02 02:27:36 +08:00
context: .
dockerfile: ./apps/mqs/Dockerfile
2024-10-02 00:57:17 +08:00
environment:
- ENV=production
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_kafka
- tyapi_etcd
- tyapi_redis
- tyapi_user
- tyapi_sentinel
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_sentinel:
container_name: tyapi_sentinel
2024-10-02 00:57:17 +08:00
build:
2024-10-02 02:27:36 +08:00
context: .
dockerfile: ./apps/sentinel/Dockerfile
2024-10-02 00:57:17 +08:00
environment:
- ENV=production
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_redis
- tyapi_mysql
- tyapi_etcd
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
2024-10-02 11:27:51 +08:00
tyapi_user:
container_name: tyapi_user
2024-10-02 00:57:17 +08:00
build:
2024-10-02 02:27:36 +08:00
context: .
dockerfile: ./apps/user/Dockerfile
2024-10-02 00:57:17 +08:00
environment:
- ENV=production
depends_on:
2024-10-02 11:27:51 +08:00
- tyapi_mysql
- tyapi_redis
- tyapi_etcd
2024-10-02 12:52:20 +08:00
- tyapi_sentinel
2024-10-02 11:27:51 +08:00
networks:
- tyapi_network
restart: always
2024-10-02 00:57:17 +08:00
volumes:
mysql_data:
2024-10-02 11:27:51 +08:00
driver: local
networks:
tyapi_network:
driver: bridge
1panel-network:
external: true