update docker
This commit is contained in:
78
docker-compose.prod.yml
Normal file
78
docker-compose.prod.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Redis Cache
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: retail-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- retail-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# NestJS API Application (Using pre-built image)
|
||||
api:
|
||||
image: renolation/retail-backend:latest # Change this to your Docker Hub or registry URL
|
||||
container_name: retail-backend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
# Application
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
API_PREFIX: api
|
||||
|
||||
# Database (Aiven PostgreSQL)
|
||||
DB_HOST: pg-30ed1d6a-renolation.b.aivencloud.com
|
||||
DB_PORT: 20912
|
||||
DB_USERNAME: avnadmin
|
||||
DB_PASSWORD: AVNS_b5AVrZdm2M2donLgXXQ
|
||||
DB_DATABASE: defaultdb
|
||||
DB_SSL: "true"
|
||||
|
||||
# JWT Configuration
|
||||
JWT_SECRET: retail-pos-super-secret-key-change-in-production-2025
|
||||
JWT_EXPIRES_IN: 1d
|
||||
|
||||
# Redis Cache
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
CACHE_TTL: 300
|
||||
|
||||
# CORS
|
||||
CORS_ORIGIN: http://localhost:3000,capacitor://localhost
|
||||
|
||||
# Rate Limiting
|
||||
THROTTLE_TTL: 60
|
||||
THROTTLE_LIMIT: 100
|
||||
|
||||
# Bcrypt
|
||||
BCRYPT_ROUNDS: 10
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- retail-network
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
volumes:
|
||||
redis-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
retail-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user