docker compose split
This commit is contained in:
48
db.docker-compose.yml
Normal file
48
db.docker-compose.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:alpine
|
||||||
|
networks:
|
||||||
|
- bot
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${PSQL_NAME}
|
||||||
|
POSTGRES_USER: ${PSQL_USER}
|
||||||
|
POSTGRES_PASSWORD: ${PSQL_PASS}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${PSQL_USER} -d ${PSQL_NAME}"]
|
||||||
|
interval: 2s
|
||||||
|
retries: 5
|
||||||
|
timeout: 10s
|
||||||
|
volumes:
|
||||||
|
- ./scripts/postgres:/docker-entrypoint-initdb.d
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
mongo:
|
||||||
|
image: mongo:noble
|
||||||
|
networks:
|
||||||
|
- bot
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
|
||||||
|
MONGO_INIDB_DATABASE: ${MONGO_NAME}
|
||||||
|
volumes:
|
||||||
|
- ./scripts/mongo:/docker-entrypoint-initdb.d
|
||||||
|
- mongo_data:/data/db
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
networks:
|
||||||
|
- bot
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
bot:
|
||||||
|
driver: bridge
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
mongo_data:
|
||||||
@@ -1,46 +1,7 @@
|
|||||||
|
include:
|
||||||
|
- db.docker-compose.yml
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
|
||||||
image: postgres:alpine
|
|
||||||
networks:
|
|
||||||
- bot
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
environment:
|
|
||||||
POSTGRES_DB: ${PSQL_NAME}
|
|
||||||
POSTGRES_USER: ${PSQL_USER}
|
|
||||||
POSTGRES_PASSWORD: ${PSQL_PASS}
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${PSQL_USER} -d ${PSQL_NAME}"]
|
|
||||||
interval: 2s
|
|
||||||
retries: 5
|
|
||||||
timeout: 10s
|
|
||||||
volumes:
|
|
||||||
- ./scripts/postgres:/docker-entrypoint-initdb.d
|
|
||||||
- postgres_data:/var/lib/postgresql/data
|
|
||||||
mongo:
|
|
||||||
image: mongo:noble
|
|
||||||
networks:
|
|
||||||
- bot
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "27017:27017"
|
|
||||||
environment:
|
|
||||||
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
|
|
||||||
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
|
|
||||||
MONGO_INIDB_DATABASE: ${MONGO_NAME}
|
|
||||||
volumes:
|
|
||||||
- ./scripts/mongo:/docker-entrypoint-initdb.d
|
|
||||||
- mongo_data:/data/db
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:alpine
|
|
||||||
networks:
|
|
||||||
- bot
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "6379:6379"
|
|
||||||
|
|
||||||
bot:
|
bot:
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
@@ -62,6 +23,3 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
bot:
|
bot:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
mongo_data:
|
|
||||||
Reference in New Issue
Block a user