Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Dependencies
node_modules/
.pnpm-store/
.pnpm-install*.log

# Debug
.log*
Expand All @@ -14,6 +16,8 @@ backup
out/
build/
coverage/
test-results/
playwright-report/

# Typescript
*.tsbuildinfo
Expand Down
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,33 @@ services:
command: ["--replSet", "rs0", "--bind_ip_all"]
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: ccw
healthcheck:
test: echo "db.runCommand('ping')" | mongosh localhost/test --quiet
interval: 5s
timeout: 5s
retries: 30
restart: unless-stopped
volumes:
- mongodb_data:/data/db

mongodb-init:
image: mongo:latest
depends_on:
mongodb:
condition: service_healthy
entrypoint: ["mongosh", "mongodb://mongodb:27017/admin", "--quiet", "--eval"]
command:
- >-
try {
rs.status();
print('MongoDB replica set already initialized');
} catch (error) {
rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'localhost:27017'}]});
print('MongoDB replica set initialized');
}
restart: "no"

volumes:
mongodb_data:
Loading
Loading