zapishis-client/docker-compose.yml
vchikalkin eef1338cd2 Add health check endpoint and controller to cache-proxy service
- Implemented a new HealthController in the cache-proxy application to provide a health check endpoint at `/api/health`, returning a simple status response.
- Updated the AppModule to include the HealthController, ensuring it is registered within the application.
- Configured a health check in the Docker Compose file for the cache-proxy service, allowing for automated health monitoring.
2025-10-06 21:50:03 +03:00

77 lines
1.5 KiB
YAML

services:
cache-proxy:
image: ${DOCKERHUB_USERNAME}/zapishis-cache-proxy:${CACHE_PROXY_IMAGE_TAG}
env_file:
- .env
restart: always
depends_on:
- redis
networks:
- app
- web
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://localhost:5000/api/health']
interval: 10s
timeout: 3s
retries: 5
web:
image: ${DOCKERHUB_USERNAME}/zapishis-web:${WEB_IMAGE_TAG}
env_file:
- .env
restart: always
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/health']
interval: 10s
timeout: 3s
retries: 5
depends_on:
- cache-proxy
networks:
- app
- web
bot:
image: ${DOCKERHUB_USERNAME}/zapishis-bot:${BOT_IMAGE_TAG}
restart: always
env_file:
- .env
depends_on:
- redis
- cache-proxy
networks:
- app
redis:
image: redis:8-alpine
restart: always
env_file:
- .env
command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}']
volumes:
- redis-data:/data
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- app
volumes:
redis-data:
networks:
app:
external: true
web:
external: true