claudia_blog/docker-compose.yml

59 lines
1.3 KiB
YAML

services:
app:
build:
context: .
dockerfile: Dockerfile
command: sh -c "npm install && npm run dev"
ports:
- "3005:3000"
- "4005:4005"
environment:
NODE_ENV: development
API_PORT: 4005
API_BASE_URL: http://localhost:4005
NEXT_PUBLIC_API_BASE_URL: http://localhost:4005
DATABASE_URL: postgres://postgres:postgres@postgres:5432/claudia_blog
CORS_ORIGINS: http://localhost:3005,http://172.25.182.67:3005
WATCHPACK_POLLING: "true"
volumes:
- .:/app
- node_modules:/app/node_modules
- uploads:/app/public/uploads
depends_on:
postgres:
condition: service_healthy
working_dir: /app
tty: true
stdin_open: true
networks:
- app-network
postgres:
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: claudia_blog
PGDATA: /tmp/pgdata
command:
- "postgres"
- "-c"
- "listen_addresses=*"
ports:
- "0.0.0.0:5433:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
node_modules:
uploads: