MongoDB was published on 0.0.0.0:27017 with the default "example" root password. It now listens on 127.0.0.1 only (the apps use the Docker network), and the root password comes from MONGO_PASSWORD in a git-ignored .env file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
936 B
YAML
38 lines
936 B
YAML
version: "3.8"
|
|
|
|
services:
|
|
mongodb:
|
|
image: mongo:latest
|
|
container_name: mongodb
|
|
ports:
|
|
# Seulement depuis la machine elle-même : les applications passent par le réseau Docker
|
|
- "127.0.0.1:27017:27017"
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: root
|
|
# Mot de passe dans .env (MONGO_PASSWORD), hors du dépôt git
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:?MONGO_PASSWORD manquant dans .env}
|
|
volumes:
|
|
- mongodb_data:/data/db
|
|
networks:
|
|
- app-network
|
|
|
|
python-app:
|
|
build: .
|
|
container_name: serverIPTV-container
|
|
depends_on:
|
|
- mongodb
|
|
environment:
|
|
- MONGO_URI=mongodb://root:${MONGO_PASSWORD:?MONGO_PASSWORD manquant dans .env}@mongodb:27017/?authSource=admin
|
|
networks:
|
|
- app-network
|
|
volumes:
|
|
- /home/ubuntu/serverIPTV/:/home/:rw
|
|
ports:
|
|
- "127.0.0.1:5023:5023"
|
|
|
|
networks:
|
|
app-network:
|
|
|
|
volumes:
|
|
mongodb_data:
|