docker compose

This commit is contained in:
2025-08-28 00:00:18 +03:00
parent ae70c229f7
commit ebb4c5926f
7 changed files with 96 additions and 31 deletions

67
docker-compose.yml Normal file
View File

@@ -0,0 +1,67 @@
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:
env_file:
- .env
- .env.production
build:
context: ./
dockerfile: ./Dockerfile
networks:
- bot
depends_on:
mongo:
condition: service_started
redis:
condition: service_started
postgres:
condition: service_healthy
restart: true
networks:
bot:
driver: bridge
volumes:
postgres_data:
mongo_data: