369 lines
9.8 KiB
YAML
369 lines
9.8 KiB
YAML
services:
|
|
mvp-platform-landing:
|
|
build:
|
|
context: ./mvp-platform-services/landing
|
|
dockerfile: Dockerfile
|
|
args:
|
|
VITE_AUTH0_DOMAIN: ${AUTH0_DOMAIN:-motovaultpro.us.auth0.com}
|
|
VITE_AUTH0_CLIENT_ID: ${AUTH0_CLIENT_ID:-yspR8zdnSxmV8wFIghHynQ08iXAPoQJ3}
|
|
VITE_TENANTS_API_URL: http://mvp-platform-tenants:8000
|
|
container_name: mvp-platform-landing
|
|
environment:
|
|
VITE_AUTH0_DOMAIN: ${AUTH0_DOMAIN:-motovaultpro.us.auth0.com}
|
|
VITE_AUTH0_CLIENT_ID: ${AUTH0_CLIENT_ID:-yspR8zdnSxmV8wFIghHynQ08iXAPoQJ3}
|
|
VITE_TENANTS_API_URL: http://mvp-platform-tenants:8000
|
|
volumes:
|
|
- ./certs:/etc/nginx/certs:ro
|
|
depends_on:
|
|
- mvp-platform-tenants
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- curl -s http://localhost:3000 || exit 1
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
mvp-platform-tenants:
|
|
build:
|
|
context: ./mvp-platform-services/tenants
|
|
dockerfile: docker/Dockerfile.api
|
|
container_name: mvp-platform-tenants
|
|
environment:
|
|
DATABASE_URL: postgresql://platform_user:${PLATFORM_DB_PASSWORD:-platform123}@platform-postgres:5432/platform
|
|
AUTH0_DOMAIN: ${AUTH0_DOMAIN:-motovaultpro.us.auth0.com}
|
|
AUTH0_AUDIENCE: ${AUTH0_AUDIENCE:-https://api.motovaultpro.com}
|
|
ports:
|
|
- 8001:8000
|
|
depends_on:
|
|
- platform-postgres
|
|
- platform-redis
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- "python -c \"import urllib.request,sys;\ntry:\n with urllib.request.urlopen('http://localhost:8000/health',\
|
|
\ timeout=3) as r:\n sys.exit(0 if r.getcode()==200 else 1)\nexcept\
|
|
\ Exception:\n sys.exit(1)\n\""
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
platform-postgres:
|
|
image: postgres:15-alpine
|
|
container_name: platform-postgres
|
|
environment:
|
|
POSTGRES_DB: platform
|
|
POSTGRES_USER: platform_user
|
|
POSTGRES_PASSWORD: ${PLATFORM_DB_PASSWORD:-platform123}
|
|
POSTGRES_INITDB_ARGS: --encoding=UTF8
|
|
volumes:
|
|
- platform_postgres_data:/var/lib/postgresql/data
|
|
- ./mvp-platform-services/tenants/sql/schema:/docker-entrypoint-initdb.d
|
|
ports:
|
|
- 5434:5432
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- pg_isready -U platform_user -d platform
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
platform-redis:
|
|
image: redis:7-alpine
|
|
container_name: platform-redis
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- platform_redis_data:/data
|
|
ports:
|
|
- 6381:6379
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- redis-cli
|
|
- ping
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
admin-postgres:
|
|
image: postgres:15-alpine
|
|
container_name: admin-postgres
|
|
environment:
|
|
POSTGRES_DB: motovaultpro
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: localdev123
|
|
POSTGRES_INITDB_ARGS: --encoding=UTF8
|
|
volumes:
|
|
- admin_postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- 5432:5432
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- pg_isready -U postgres
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
admin-redis:
|
|
image: redis:7-alpine
|
|
container_name: admin-redis
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- admin_redis_data:/data
|
|
ports:
|
|
- 6379:6379
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- redis-cli
|
|
- ping
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
admin-minio:
|
|
image: minio/minio:latest
|
|
container_name: admin-minio
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: minioadmin123
|
|
volumes:
|
|
- admin_minio_data:/data
|
|
ports:
|
|
- 9000:9000
|
|
- 9001:9001
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- curl
|
|
- -f
|
|
- http://localhost:9000/minio/health/live
|
|
interval: 30s
|
|
timeout: 20s
|
|
retries: 3
|
|
admin-backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
cache_from:
|
|
- node:20-alpine
|
|
container_name: admin-backend
|
|
environment:
|
|
TENANT_ID: ${TENANT_ID:-admin}
|
|
PORT: 3001
|
|
DB_HOST: admin-postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: motovaultpro
|
|
DB_USER: postgres
|
|
DB_PASSWORD: localdev123
|
|
REDIS_HOST: admin-redis
|
|
REDIS_PORT: 6379
|
|
MINIO_ENDPOINT: admin-minio
|
|
MINIO_PORT: 9000
|
|
MINIO_ACCESS_KEY: minioadmin
|
|
MINIO_SECRET_KEY: minioadmin123
|
|
MINIO_BUCKET: motovaultpro
|
|
AUTH0_DOMAIN: ${AUTH0_DOMAIN:-motovaultpro.us.auth0.com}
|
|
AUTH0_CLIENT_ID: ${AUTH0_CLIENT_ID:-your-client-id}
|
|
AUTH0_CLIENT_SECRET: ${AUTH0_CLIENT_SECRET:-your-client-secret}
|
|
AUTH0_AUDIENCE: ${AUTH0_AUDIENCE:-https://api.motovaultpro.com}
|
|
GOOGLE_MAPS_API_KEY: ${GOOGLE_MAPS_API_KEY:-your-google-maps-key}
|
|
VPIC_API_URL: https://vpic.nhtsa.dot.gov/api/vehicles
|
|
PLATFORM_VEHICLES_API_URL: http://mvp-platform-vehicles-api:8000
|
|
PLATFORM_VEHICLES_API_KEY: mvp-platform-vehicles-secret-key
|
|
PLATFORM_TENANTS_API_URL: ${PLATFORM_TENANTS_API_URL:-http://mvp-platform-tenants:8000}
|
|
ports:
|
|
- 3001:3001
|
|
depends_on:
|
|
- admin-postgres
|
|
- admin-redis
|
|
- admin-minio
|
|
- mvp-platform-vehicles-api
|
|
- mvp-platform-tenants
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- node -e "require('http').get('http://localhost:3001/health', r => process.exit(r.statusCode===200?0:1)).on('error',
|
|
() => process.exit(1))"
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
admin-frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
cache_from:
|
|
- node:20-alpine
|
|
- nginx:alpine
|
|
args:
|
|
VITE_AUTH0_DOMAIN: ${VITE_AUTH0_DOMAIN:-motovaultpro.us.auth0.com}
|
|
VITE_AUTH0_CLIENT_ID: ${VITE_AUTH0_CLIENT_ID:-yspR8zdnSxmV8wFIghHynQ08iXAPoQJ3}
|
|
VITE_AUTH0_AUDIENCE: ${VITE_AUTH0_AUDIENCE:-https://api.motovaultpro.com}
|
|
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api}
|
|
container_name: admin-frontend
|
|
environment:
|
|
VITE_TENANT_ID: ${TENANT_ID:-admin}
|
|
VITE_API_BASE_URL: /api
|
|
VITE_AUTH0_DOMAIN: ${VITE_AUTH0_DOMAIN:-motovaultpro.us.auth0.com}
|
|
VITE_AUTH0_CLIENT_ID: ${VITE_AUTH0_CLIENT_ID:-yspR8zdnSxmV8wFIghHynQ08iXAPoQJ3}
|
|
VITE_AUTH0_AUDIENCE: ${VITE_AUTH0_AUDIENCE:-https://api.motovaultpro.com}
|
|
volumes:
|
|
- ./certs:/etc/nginx/certs:ro
|
|
depends_on:
|
|
- admin-backend
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- curl -s http://localhost:3000 || exit 1
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
mvp-platform-vehicles-db:
|
|
image: postgres:15-alpine
|
|
container_name: mvp-platform-vehicles-db
|
|
command: 'postgres
|
|
|
|
-c shared_buffers=4GB
|
|
|
|
-c work_mem=256MB
|
|
|
|
-c maintenance_work_mem=1GB
|
|
|
|
-c effective_cache_size=12GB
|
|
|
|
-c max_connections=100
|
|
|
|
-c checkpoint_completion_target=0.9
|
|
|
|
-c wal_buffers=256MB
|
|
|
|
-c max_wal_size=8GB
|
|
|
|
-c min_wal_size=2GB
|
|
|
|
-c synchronous_commit=off
|
|
|
|
-c full_page_writes=off
|
|
|
|
-c fsync=off
|
|
|
|
-c random_page_cost=1.1
|
|
|
|
-c seq_page_cost=1
|
|
|
|
-c max_worker_processes=8
|
|
|
|
-c max_parallel_workers=8
|
|
|
|
-c max_parallel_workers_per_gather=4
|
|
|
|
-c max_parallel_maintenance_workers=4
|
|
|
|
'
|
|
environment:
|
|
POSTGRES_DB: vehicles
|
|
POSTGRES_USER: mvp_platform_user
|
|
POSTGRES_PASSWORD: platform123
|
|
POSTGRES_INITDB_ARGS: --encoding=UTF8
|
|
volumes:
|
|
- platform_vehicles_data:/var/lib/postgresql/data
|
|
- ./mvp-platform-services/vehicles/sql/schema:/docker-entrypoint-initdb.d
|
|
ports:
|
|
- 5433:5432
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 6G
|
|
cpus: '6.0'
|
|
reservations:
|
|
memory: 4G
|
|
cpus: '4.0'
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- pg_isready -U mvp_platform_user -d vehicles
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
mvp-platform-vehicles-redis:
|
|
image: redis:7-alpine
|
|
container_name: mvp-platform-vehicles-redis
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- platform_vehicles_redis_data:/data
|
|
ports:
|
|
- 6380:6379
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- redis-cli
|
|
- ping
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
mvp-platform-vehicles-api:
|
|
build:
|
|
context: ./mvp-platform-services/vehicles
|
|
dockerfile: docker/Dockerfile.api
|
|
container_name: mvp-platform-vehicles-api
|
|
environment:
|
|
POSTGRES_HOST: mvp-platform-vehicles-db
|
|
POSTGRES_PORT: 5432
|
|
POSTGRES_DATABASE: vehicles
|
|
POSTGRES_USER: mvp_platform_user
|
|
POSTGRES_PASSWORD: platform123
|
|
REDIS_HOST: mvp-platform-vehicles-redis
|
|
REDIS_PORT: 6379
|
|
API_KEY: mvp-platform-vehicles-secret-key
|
|
DEBUG: true
|
|
CORS_ORIGINS: '["http://localhost:3000", "https://motovaultpro.com", "http://localhost:3001"]'
|
|
ports:
|
|
- 8000:8000
|
|
depends_on:
|
|
- mvp-platform-vehicles-db
|
|
- mvp-platform-vehicles-redis
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- wget
|
|
- --quiet
|
|
- --tries=1
|
|
- --spider
|
|
- http://localhost:8000/health
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
nginx-proxy:
|
|
image: nginx:alpine
|
|
container_name: nginx-proxy
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
volumes:
|
|
- ./nginx-proxy/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./certs:/etc/nginx/certs:ro
|
|
depends_on:
|
|
- mvp-platform-landing
|
|
- admin-frontend
|
|
- admin-backend
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- nginx
|
|
- -t
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
volumes:
|
|
platform_postgres_data: null
|
|
platform_redis_data: null
|
|
admin_postgres_data: null
|
|
admin_redis_data: null
|
|
admin_minio_data: null
|
|
platform_vehicles_data: null
|
|
platform_vehicles_redis_data: null
|
|
platform_vehicles_mssql_data: null
|