- Next.js 15 with App Router, TypeScript, Tailwind CSS (v4), ESLint - docker-compose.yml with PostgreSQL 16, Redis 7, and app service - Dockerfile (Node 20 alpine) for containerized development - .env and .env.example with DATABASE_URL, DATABASE_URL_LOCAL, REDIS_URL - src/app/page.tsx updated to render NetForge heading - All three services start healthy with docker compose up -d
60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: netforge_db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: netforge
|
|
POSTGRES_PASSWORD: netforge_dev
|
|
POSTGRES_DB: netforge_dev
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U netforge -d netforge_dev"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: netforge_redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: netforge_app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- .:/app
|
|
- /app/node_modules
|
|
- /app/.next
|
|
environment:
|
|
- DATABASE_URL=postgresql://netforge:netforge_dev@db:5432/netforge_dev
|
|
- REDIS_URL=redis://redis:6379
|
|
- NEXTAUTH_SECRET=dev-secret-change-in-production
|
|
- NEXTAUTH_URL=http://localhost:3000
|
|
- NODE_ENV=development
|
|
env_file:
|
|
- .env
|
|
|
|
volumes:
|
|
postgres_data:
|