Initial Commit
This commit is contained in:
@@ -1,127 +1,467 @@
|
||||
services:
|
||||
postgres:
|
||||
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: mvp-postgres
|
||||
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"
|
||||
POSTGRES_INITDB_ARGS: --encoding=UTF8
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- admin_postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- 5432:5432
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- pg_isready -U postgres
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
admin-redis:
|
||||
image: redis:7-alpine
|
||||
container_name: mvp-redis
|
||||
container_name: admin-redis
|
||||
command: redis-server --appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
- admin_redis_data:/data
|
||||
ports:
|
||||
- "6379:6379"
|
||||
- 6379:6379
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
test:
|
||||
- CMD
|
||||
- redis-cli
|
||||
- ping
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
minio:
|
||||
admin-minio:
|
||||
image: minio/minio:latest
|
||||
container_name: mvp-minio
|
||||
container_name: admin-minio
|
||||
command: server /data --console-address ":9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadmin123
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
- admin_minio_data:/data
|
||||
ports:
|
||||
- "9000:9000" # API
|
||||
- "9001:9001" # Console
|
||||
- 9000:9000
|
||||
- 9001:9001
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
test:
|
||||
- CMD
|
||||
- curl
|
||||
- -f
|
||||
- http://localhost:9000/minio/health/live
|
||||
interval: 30s
|
||||
timeout: 20s
|
||||
retries: 3
|
||||
|
||||
backend:
|
||||
admin-backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
cache_from:
|
||||
- node:20-alpine
|
||||
container_name: mvp-backend
|
||||
- node:20-alpine
|
||||
container_name: admin-backend
|
||||
environment:
|
||||
TENANT_ID: ${TENANT_ID:-admin}
|
||||
PORT: 3001
|
||||
DB_HOST: postgres
|
||||
DB_HOST: admin-postgres
|
||||
DB_PORT: 5432
|
||||
DB_NAME: motovaultpro
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: localdev123
|
||||
REDIS_HOST: redis
|
||||
REDIS_HOST: admin-redis
|
||||
REDIS_PORT: 6379
|
||||
MINIO_ENDPOINT: minio
|
||||
MINIO_ENDPOINT: admin-minio
|
||||
MINIO_PORT: 9000
|
||||
MINIO_ACCESS_KEY: minioadmin
|
||||
MINIO_SECRET_KEY: minioadmin123
|
||||
MINIO_BUCKET: motovaultpro
|
||||
AUTH0_DOMAIN: ${AUTH0_DOMAIN:-your-domain.auth0.com}
|
||||
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"
|
||||
- 3001:3001
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- minio
|
||||
- admin-postgres
|
||||
- admin-redis
|
||||
- admin-minio
|
||||
- mvp-platform-vehicles-api
|
||||
- mvp-platform-tenants
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/health"]
|
||||
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
|
||||
|
||||
frontend:
|
||||
admin-frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
cache_from:
|
||||
- node:20-alpine
|
||||
- nginx:alpine
|
||||
- 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: mvp-frontend
|
||||
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}
|
||||
ports:
|
||||
- "0.0.0.0:3000:3000" # HTTP (redirects to HTTPS)
|
||||
- "0.0.0.0:443:3443" # HTTPS
|
||||
volumes:
|
||||
- ./certs:/etc/nginx/certs:ro # Mount SSL certificates
|
||||
- ./certs:/etc/nginx/certs:ro
|
||||
depends_on:
|
||||
- backend
|
||||
- admin-backend
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "--no-check-certificate", "https://localhost:3443"]
|
||||
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-mssql:
|
||||
image: mcr.microsoft.com/mssql/server:2019-CU32-ubuntu-20.04
|
||||
container_name: mvp-platform-vehicles-mssql
|
||||
profiles:
|
||||
- mssql-monthly
|
||||
user: root
|
||||
environment:
|
||||
ACCEPT_EULA: Y
|
||||
SA_PASSWORD: Platform123!
|
||||
MSSQL_PID: Developer
|
||||
volumes:
|
||||
- platform_vehicles_mssql_data:/var/opt/mssql/data
|
||||
- ./mvp-platform-services/vehicles/mssql/backups:/backups
|
||||
ports:
|
||||
- 1433:1433
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Platform123!' -Q 'SELECT
|
||||
1' || exit 1
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
mvp-platform-vehicles-etl:
|
||||
build:
|
||||
context: ./mvp-platform-services/vehicles
|
||||
dockerfile: docker/Dockerfile.etl
|
||||
container_name: mvp-platform-vehicles-etl
|
||||
environment:
|
||||
MSSQL_HOST: mvp-platform-vehicles-mssql
|
||||
MSSQL_PORT: 1433
|
||||
MSSQL_DATABASE: VPICList
|
||||
MSSQL_USER: sa
|
||||
MSSQL_PASSWORD: Platform123!
|
||||
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
|
||||
ETL_SCHEDULE: 0 2 * * 0
|
||||
volumes:
|
||||
- ./mvp-platform-services/vehicles/etl:/app/etl
|
||||
- ./mvp-platform-services/vehicles/logs:/app/logs
|
||||
- ./mvp-platform-services/vehicles/mssql/backups:/app/shared
|
||||
depends_on:
|
||||
- mvp-platform-vehicles-db
|
||||
- mvp-platform-vehicles-redis
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 6G
|
||||
cpus: '4.0'
|
||||
reservations:
|
||||
memory: 3G
|
||||
cpus: '2.0'
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -c
|
||||
- import psycopg2; psycopg2.connect(host='mvp-platform-vehicles-db', port=5432,
|
||||
database='vehicles', user='mvp_platform_user', password='platform123').close()
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
mvp-platform-vehicles-etl-manual:
|
||||
build:
|
||||
context: ./mvp-platform-services/vehicles
|
||||
dockerfile: docker/Dockerfile.etl
|
||||
container_name: mvp-platform-vehicles-etl-manual
|
||||
profiles:
|
||||
- manual
|
||||
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
|
||||
volumes:
|
||||
- ./mvp-platform-services/vehicles/etl:/app/etl
|
||||
- ./mvp-platform-services/vehicles/logs:/app/logs
|
||||
depends_on:
|
||||
- mvp-platform-vehicles-db
|
||||
- mvp-platform-vehicles-redis
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
cpus: '2.0'
|
||||
reservations:
|
||||
memory: 2G
|
||||
cpus: '1.0'
|
||||
command: ["tail", "-f", "/dev/null"]
|
||||
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:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
minio_data:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user