92 lines
2.2 KiB
YAML
92 lines
2.2 KiB
YAML
# =============================================================================
|
|
# Docker Compose - Production Configuration
|
|
# =============================================================================
|
|
# Optimized for: Coolify deployment with production best practices
|
|
# =============================================================================
|
|
|
|
services:
|
|
app:
|
|
image: nobat724-front:latest
|
|
container_name: nobat724-app
|
|
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
# Enable BuildKit for better caching
|
|
args:
|
|
BUILDKIT_INLINE_CACHE: "1"
|
|
# Multi-platform support (optional)
|
|
# platforms:
|
|
# - linux/amd64
|
|
# - linux/arm64
|
|
|
|
# Restart policy
|
|
restart: unless-stopped
|
|
|
|
# Port mapping (Coolify handles external mapping)
|
|
ports:
|
|
- "3000:3000"
|
|
|
|
# Environment variables
|
|
environment:
|
|
# Next.js runtime
|
|
PORT: 3000
|
|
HOSTNAME: "0.0.0.0"
|
|
NODE_ENV: production
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
# API configuration
|
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://api.nobat724.com}
|
|
NEXT_PUBLIC_CLIENT_ID: ${NEXT_PUBLIC_CLIENT_ID}
|
|
NEXT_PUBLIC_CLIENT_SECRET: ${NEXT_PUBLIC_CLIENT_SECRET}
|
|
DEV_MODE: "false"
|
|
|
|
# Health check (uses Dockerfile HEALTHCHECK)
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
'node -e "require(''http'').get(''http://localhost:3000/'', (res) => { process.exit(res.statusCode === 200 ? 0 : 1); }).on(''error'', () => { process.exit(1); });"',
|
|
]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Resource limits
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1.0"
|
|
memory: 1G
|
|
reservations:
|
|
cpus: "0.25"
|
|
memory: 256M
|
|
|
|
# Logging configuration
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
# Security options
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
# Read-only root filesystem (except for .next cache)
|
|
# read_only: true
|
|
# tmpfs:
|
|
# - /tmp
|
|
# - /app/.next/cache
|
|
|
|
# Networks
|
|
networks:
|
|
- coolify
|
|
|
|
# Network configuration
|
|
networks:
|
|
coolify:
|
|
name: coolify
|
|
external: true
|