-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
45 lines (45 loc) · 1.05 KB
/
compose.yml
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
43
44
45
version: '3.8'
services:
database:
image: mongo:7
ports:
- 45678:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 123456
volumes:
- ./database/data:/data/db
- ./database/init:/docker-entrypoint-initdb.d
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh database:27017 --quiet
start_period: 10s
interval: 3s
timeout: 10s
retries: 3
app:
build:
context: ./
target: base
command: sh -c "yarn run dev"
environment:
APP_PORT: ${APP_PORT}
MONGODB_URL: ${MONGODB_URL}
ports:
- ${APP_PORT}:${APP_PORT}
healthcheck:
test: wget -qO- http://app:$APP_PORT/health || exit 1
start_period: 5s
interval: 5s
timeout: 3s
retries: 3
depends_on:
database:
condition: service_healthy
restart: true
develop:
watch:
- action: sync
path: ./src
target: /url-shortener/src
- action: rebuild
path: package.json