Skip to content

Commit

Permalink
🚧 progress: First draft for compose.yaml.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 17, 2024
1 parent f3d86cd commit 5b84516
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ROOT_URL=http://localhost
PORT=3000

MONGO_VERSION=5.0
MONGO_URL=mongodb://patient-db:27017/meteor
56 changes: 56 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
services:
patient-web:
restart: always
build:
context: .
environment:
- ROOT_URL=${ROOT_URL}
- PORT=${PORT}
- MONGO_URL=${MONGO_URL}
depends_on:
patient-db:
condition: service_healthy
networks:
- patient-network
ports:
- "${PORT}:${PORT}"

patient-db:
restart: always
image: "mongo:${MONGO_VERSION}"
volumes:
- patient-data:/data/db
- ./scripts/ensure-replica-set.js:/scripts/ensure-replica-set.js
networks:
- patient-network
expose:
- 27017
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "7"
entrypoint: [
"mongod",
"--bind_ip", "localhost,patient-db",
"--dbpath", "/data/db",
"--replSet", "meteor"
]
healthcheck:
test: [
"CMD",
"mongo",
"--eval", "replSet = 'meteor'; hostname = 'patient-db'",
"/scripts/ensure-replica-set.js"
]
start_period: 40s
start_interval: 2s
interval: 1m30s
timeout: 10s
retries: 3

networks:
patient-network:

volumes:
patient-data:

0 comments on commit 5b84516

Please sign in to comment.