feat(docker): implement full frontend Next.js containerization and multi-service docker-compose
- Create multi-stage standalone Dockerfile for Next.js frontend (node:20-alpine, non-root nextjs:nodejs user) - Configure output: 'standalone' in refer_landing_page/next.config.js - Add refer_landing_page/.dockerignore for build context optimization - Wire anl-backend and anl-frontend services in root docker-compose.yml with healthchecks, network dependencies, and persistent volume storage
This commit is contained in:
+25
-1
@@ -14,13 +14,37 @@ services:
|
||||
- GIN_MODE=release
|
||||
- CORS_ALLOW_ORIGINS=*
|
||||
- AUTO_MIGRATE=true
|
||||
- ADMIN_TOKEN=${ADMIN_TOKEN:-anl-admin-secret-token-2026}
|
||||
volumes:
|
||||
- anl-db-data:/app/data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"]
|
||||
interval: 30s
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
|
||||
anl-frontend:
|
||||
build:
|
||||
context: ./refer_landing_page
|
||||
dockerfile: Dockerfile
|
||||
container_name: anl-frontend-web
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
- NEXT_PUBLIC_API_URL=http://localhost:8080/api/v1
|
||||
depends_on:
|
||||
anl-backend:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"]
|
||||
interval: 15s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
anl-db-data:
|
||||
|
||||
Reference in New Issue
Block a user