Fix for production
This commit is contained in:
+46
-20
@@ -1,32 +1,40 @@
|
||||
# Production / Dokploy
|
||||
# دامنهها را در UIی Dokploy به سرویسها ببندید:
|
||||
# client → https://wheel.montzar.ir
|
||||
# api → https://api.wheel.montzar.ir (port 3000)
|
||||
# admin → https://adm.wheel.montzar.ir
|
||||
#
|
||||
# بیلد لوکال قبل از push:
|
||||
# pnpm install && pnpm run build:release
|
||||
#
|
||||
# env: از .env.production.example کپی کنید و در Dokploy ست کنید.
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: lucky_wheel_postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: lucky_wheel
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgrespassword
|
||||
POSTGRES_DB: ${POSTGRES_DB:-lucky_wheel}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgrespassword}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- '${EXPORT_DB_PORT:-5432}:5432'
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres -d lucky_wheel" ]
|
||||
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: lucky_wheel_redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6380:6379"
|
||||
command: ['redis-server', '--appendonly', 'yes']
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
test: ['CMD', 'redis-cli', 'ping']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -35,15 +43,34 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/api/Dockerfile
|
||||
container_name: lucky_wheel_api
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://postgres:postgrespassword@postgres:5432/lucky_wheel?schema=public
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- NODE_ENV=production
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgrespassword@postgres:5432/lucky_wheel?schema=public}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: '6379'
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
||||
JWT_USER_SECRET: ${JWT_USER_SECRET:-change-me-user-jwt}
|
||||
JWT_USER_EXPIRES_IN: ${JWT_USER_EXPIRES_IN:-7d}
|
||||
JWT_ADMIN_ACCESS_SECRET: ${JWT_ADMIN_ACCESS_SECRET:-change-me-admin-access-jwt}
|
||||
JWT_ADMIN_ACCESS_EXPIRES_IN: ${JWT_ADMIN_ACCESS_EXPIRES_IN:-1h}
|
||||
JWT_ADMIN_REFRESH_SECRET: ${JWT_ADMIN_REFRESH_SECRET:-change-me-admin-refresh-jwt}
|
||||
JWT_ADMIN_REFRESH_EXPIRES_IN: ${JWT_ADMIN_REFRESH_EXPIRES_IN:-7d}
|
||||
CORS_ADMIN_ORIGIN: ${CORS_ADMIN_ORIGIN:-https://adm.wheel.montzar.ir}
|
||||
CORS_CLIENT_ORIGIN: ${CORS_CLIENT_ORIGIN:-https://wheel.montzar.ir}
|
||||
STORAGE_DRIVER: ${STORAGE_DRIVER:-local}
|
||||
STORAGE_LOCAL_ROOT: ${STORAGE_LOCAL_ROOT:-./uploads}
|
||||
STORAGE_PUBLIC_URL: ${STORAGE_PUBLIC_URL:-https://api.wheel.montzar.ir/uploads}
|
||||
SMS_DRIVER: ${SMS_DRIVER:-mock}
|
||||
RAYGAN_SMS_USERNAME: ${RAYGAN_SMS_USERNAME:-}
|
||||
RAYGAN_SMS_PASSWORD: ${RAYGAN_SMS_PASSWORD:-}
|
||||
RAYGAN_SMS_LINE_NUMBER: ${RAYGAN_SMS_LINE_NUMBER:-}
|
||||
RAYGAN_SMS_API_BASE_URL: ${RAYGAN_SMS_API_BASE_URL:-https://api.raygansms.com}
|
||||
volumes:
|
||||
- uploads_data:/app/uploads
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -54,10 +81,9 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/admin/Dockerfile
|
||||
container_name: lucky_wheel_admin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
- '8080:80'
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
@@ -65,13 +91,13 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/client/Dockerfile
|
||||
container_name: lucky_wheel_client
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- '8081:80'
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
volumes:
|
||||
pg_data:
|
||||
redis_data:
|
||||
uploads_data:
|
||||
|
||||
Reference in New Issue
Block a user