M1_ProjetWeb/docker-compose.yml

59 lines
1.3 KiB
YAML
Raw Normal View History

services:
2024-12-17 17:43:15 +01:00
2024-12-18 09:38:42 +01:00
app:
build: .
hostname: app
depends_on:
- mongodb
- redis
environment:
- DATABASE_URL=mongodb://temp-root-username:temp-password@mongodb/chat_projetweb?authSource=admin
- JWT_SECRET=ba63466f102443f4bb6f3670891358bc4488d0c717f6ebcd3ee3c5144e55fe2d
ports:
- "3000:3000"
networks:
- app_network
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
mongodb:
build: ./mongodb_rs
hostname: mongodb
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=temp-root-username
- MONGO_INITDB_ROOT_PASSWORD=temp-password
- MONGO_INITDB_DATABASE=chat_projetweb
2024-12-18 09:38:42 +01:00
- MONGO_REPLICA_HOST=mongodb
- MONGO_REPLICA_PORT=27017
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db/
- mongo-logs:/var/log/mongodb/
networks:
2024-12-17 17:43:15 +01:00
- app_network
redis:
image: redis:latest
2024-12-17 17:43:15 +01:00
hostname: redis-server
restart: always
ports:
- "6379:6379"
command: redis-server --save 20 1 --loglevel warning
environment:
- REDIS_PASSWORD=temp-redis-password
volumes:
- redis-data:/root/redis
networks:
2024-12-17 17:43:15 +01:00
- app_network
networks:
2024-12-17 17:43:15 +01:00
app_network:
driver: bridge
volumes:
mongo-data:
mongo-logs:
redis-data: