codewithgarry
Version:
Girish Sharma's NPX business card - DevOps Engineer & Cloud Architect - Connect with me directly via terminal!
91 lines (85 loc) • 2.39 kB
YAML
version: '3.8'
services:
# Main NPX card service
npx-card:
build:
context: .
dockerfile: Dockerfile
target: production
image: codewithgarry-npx-card:latest
container_name: codewithgarry-card
restart: unless-stopped
environment:
- NODE_ENV=production
- LOG_LEVEL=info
ports:
- "3000:3000"
networks:
- card-network
volumes:
# Mount logs directory for debugging
- ./logs:/app/logs:rw
healthcheck:
test: ["CMD", "node", "-e", "console.log('healthy')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Web version service (if needed)
web-version:
image: nginx:alpine
container_name: codewithgarry-web
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./advanced-learning-platform.html:/usr/share/nginx/html/index.html:ro
- ./web-version.html:/usr/share/nginx/html/card.html:ro
- ./platform-features.js:/usr/share/nginx/html/platform-features.js:ro
- ./blog-system.js:/usr/share/nginx/html/blog-system.js:ro
- ./quiz-course-system.js:/usr/share/nginx/html/quiz-course-system.js:ro
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- card-network
depends_on:
- npx-card
# Redis for caching (optional)
redis:
image: redis:7-alpine
container_name: codewithgarry-redis
restart: unless-stopped
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
- card-network
# Monitoring with Prometheus (optional)
prometheus:
image: prom/prometheus:latest
container_name: codewithgarry-prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
networks:
- card-network
networks:
card-network:
driver: bridge
name: codewithgarry-network
volumes:
redis-data:
driver: local
prometheus-data:
driver: local