Optimize frontend for production using multi-stage standalone build

This commit is contained in:
2026-07-27 13:26:31 +05:30
parent f5049ef965
commit c214ca41b6
3 changed files with 72 additions and 7 deletions

View File

@@ -20,6 +20,20 @@ services:
timeout: 5s
retries: 5
pgbouncer:
image: edoburu/pgbouncer
container_name: pragativeer_pgbouncer
environment:
- DATABASE_URL=postgres://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod
- POOL_MODE=transaction
- MAX_CLIENT_CONN=1000
- DEFAULT_POOL_SIZE=50
depends_on:
postgres:
condition: service_healthy
networks:
- pragativeer_network
redis:
image: redis:7-alpine
container_name: pragativeer_cache
@@ -41,7 +55,7 @@ services:
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@pgbouncer:5432/pragativeer_prod
- REDIS_URL=redis://redis:6379/0
- ENV=development
- MINIO_ENDPOINT=minio:9000
@@ -65,7 +79,7 @@ services:
volumes:
- ./backend:/app
environment:
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@pgbouncer:5432/pragativeer_prod
- REDIS_URL=redis://redis:6379/0
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=minio_admin
@@ -88,7 +102,7 @@ services:
volumes:
- ./backend:/app
environment:
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@pgbouncer:5432/pragativeer_prod
- REDIS_URL=redis://redis:6379/0
env_file:
- ./backend/.env
@@ -101,13 +115,10 @@ services:
frontend:
build:
context: .
dockerfile: Dockerfile.dev
dockerfile: Dockerfile
container_name: pragativeer_frontend
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8000
depends_on: