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

69 lines
1.2 KiB
YAML
Raw Normal View History

2024-07-03 18:52:30 +00:00
version: '3.9'
services:
redis:
container_name: redis
image: redis:6.2.14-alpine
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 10s
retries: 10
ports:
- 6379:6379
expose:
- 6379
restart: always
networks:
- x_trait_network
server:
container_name: server
image: pandrive:0.1.0
volumes:
- .:/app
ports:
- 3000:3000
expose:
- 3000
restart: always
networks:
- x_trait_network
links:
- database
- redis
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
database:
container_name: database
image: mysql:8
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "database" ]
timeout: 10s
retries: 10
cap_add:
- SYS_NICE
ports:
- 3306:3306
expose:
- 3306
volumes:
- db:/var/lib/mysql
restart: always
networks:
- x_trait_network
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
networks:
x_trait_network:
driver: bridge
volumes:
db:
driver: local