39 lines
747 B
YAML
39 lines
747 B
YAML
version: '3'
|
|
services:
|
|
db:
|
|
image: mongo:latest
|
|
volumes:
|
|
- mongo-data:/data/db
|
|
networks:
|
|
- backend-network
|
|
|
|
backend:
|
|
build: ./backend
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
- MONGO_SERVICE_NAME=db
|
|
- MONGO_PORT=27017
|
|
networks:
|
|
- backend-network
|
|
- frontend-network
|
|
ports:
|
|
- "8000:8000"
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- frontend-network
|
|
ports:
|
|
- "80:80"
|
|
|
|
volumes:
|
|
mongo-data:
|
|
|
|
# Pour la sécurité, c'est mieux d'avoir deux réseaux (vu en CM) -> même si dans notre cas ce n'est pas utile + internal true isole le réseau
|
|
networks:
|
|
backend-network:
|
|
internal: true
|
|
frontend-network: |