Files
asle/docker-compose.yml

76 lines
1.7 KiB
YAML
Raw Permalink Normal View History

version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-asle}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-asle_password}
POSTGRES_DB: ${POSTGRES_DB:-asle}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U asle"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "4000:4000"
environment:
- NODE_ENV=${NODE_ENV:-development}
- DATABASE_URL=postgresql://${POSTGRES_USER:-asle}:${POSTGRES_PASSWORD:-asle_password}@postgres:5432/${POSTGRES_DB:-asle}?schema=public
- REDIS_URL=redis://redis:6379
- RPC_URL=${RPC_URL:-http://host.docker.internal:8545}
- DIAMOND_ADDRESS=${DIAMOND_ADDRESS}
- JWT_SECRET=${JWT_SECRET:-change-me-in-production}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
- /app/node_modules
command: npm run dev
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:4000/api
- NEXT_PUBLIC_DIAMOND_ADDRESS=${DIAMOND_ADDRESS}
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
command: npm run dev
volumes:
postgres_data:
redis_data: