ininventer/docker-compose.example.yml

94 lines
2.2 KiB
YAML

version: '3.8'
services:
# MongoDB Service
mongodb:
image: mongo:6
container_name: ininventer-mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
volumes:
- mongodb_data:/data/db
networks:
- ininventer-network
# Backend API Service
backend:
build: ./backend
container_name: ininventer-backend
restart: unless-stopped
ports:
- "5000:5000"
environment:
NODE_ENV: ${NODE_ENV:-development}
MONGO_URI: ${MONGO_URI}
JWT_SECRET: ${JWT_SECRET}
JWT_EXPIRATION: ${JWT_EXPIRATION:-24h}
PORT: ${PORT:-5000}
SUPERADMIN_EMAIL: ${SUPERADMIN_EMAIL}
SUPERADMIN_PASSWORD: ${SUPERADMIN_PASSWORD}
depends_on:
- mongodb
networks:
- ininventer-network
volumes:
- ./backend:/app
- /app/node_modules
# Frontend Service
frontend:
build: ./frontend
container_name: ininventer-frontend
restart: unless-stopped
ports:
- "3000:80"
depends_on:
- backend
networks:
- ininventer-network
environment:
VITE_API_URL: ${VITE_API_URL:-http://localhost:5000}
# Nginx Service (Reverse Proxy)
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: ininventer-nginx
restart: always
ports:
- "8080:80"
- "8443:443"
volumes:
- ./nginx/certbot/conf:/etc/letsencrypt
- ./nginx/certbot/www:/var/www/certbot
depends_on:
- frontend
- backend
networks:
- app-network
# Certbot Service for SSL - Commented out for local development
# Uncomment this section when deploying to production
# certbot:
# image: certbot/certbot
# container_name: ininventer-certbot
# volumes:
# - ./nginx/certbot/conf:/etc/letsencrypt
# - ./nginx/certbot/www:/var/www/certbot
# command: certonly --webroot --webroot-path=/var/www/certbot --email ${CERTBOT_EMAIL} --agree-tos --no-eff-email -d ${DOMAIN_NAME}
volumes:
mongodb_data:
networks:
ininventer-network:
driver: bridge
app-network:
driver: bridge