gohorsejobs/docker-compose.dev.yml

57 lines
1.4 KiB
YAML

services:
db:
image: postgres:16-alpine
container_name: ghj-db-dev
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: gohorsejobs
ports:
- "5432:5432"
volumes:
- ghj-db-dev-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d gohorsejobs"]
interval: 5s
timeout: 5s
retries: 5
backend:
image: cosmtrek/air
container_name: ghj-backend-dev
working_dir: /app
ports:
- "8521:8521"
environment:
- DATABASE_URL=postgresql://user:password@db:5432/gohorsejobs?sslmode=disable
- JWT_SECRET=rede5-secret-key-at-least-32-chars-long
- PASSWORD_PEPPER=rede5-pepper
- COOKIE_SECRET=rede5-cookie-secret
- ENV=development
- BACKEND_PORT=8521
- CORS_ORIGINS=https://ghj.rede5.com.br,http://localhost:3000
volumes:
- ./backend:/app
- ./air.toml:/app/.air.toml
depends_on:
db:
condition: service_healthy
command: -c .air.toml
frontend:
image: node:22-alpine
container_name: ghj-frontend-dev
working_dir: /app
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=https://api-ghj.rede5.com.br/api/v1
- NODE_ENV=development
volumes:
- ./frontend:/app
depends_on:
- backend
command: sh -c "npm install && npm run dev"
volumes:
ghj-db-dev-data: