-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
42 lines (39 loc) · 974 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
42 lines (39 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: "3.9"
services:
mongodb:
image: mongo:7.0-alpine
container_name: tracks-ip-mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
MONGO_INITDB_DATABASE: tracks-ip
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- ./init-db.js:/docker-entrypoint-initdb.d/init-db.js:ro
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
container_name: tracks-ip-app
environment:
MONGODB_URI: mongodb://admin:password123@mongodb:27017/tracks-ip?authSource=admin
NODE_ENV: development
ports:
- "3000:3000"
depends_on:
mongodb:
condition: service_healthy
volumes:
- .:/app
- /app/node_modules
- /app/.next
command: pnpm dev
volumes:
mongodb_data: