node-api-template/docker-compose.development.yml

73 lines
1.3 KiB
YAML

services:
redis:
container_name: node_api_redis
image: redis:6.2.14-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
ports:
- 6379:6379
expose:
- 6379
restart: always
networks:
- node_api_network
server:
container_name: node_api_server
build:
context: .
dockerfile: Dockerfile.development
volumes:
- .:/app
ports:
- 3000:3000
expose:
- 3000
restart: always
networks:
- node_api_network
environment:
- REDIS_HOST=redis
links:
- database
- redis
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
database:
container_name: node_api_database
image: postgres:16.3
user: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
cap_add:
- SYS_NICE
ports:
- 5432:5432
expose:
- 5432
volumes:
- db:/var/lib/postgresql/data
restart: always
networks:
- node_api_network
environment:
- POSTGRES_PASSWORD=myPassword
networks:
node_api_network:
driver: bridge
volumes:
db:
driver: local