-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (58 loc) · 1.73 KB
/
docker-compose.yml
File metadata and controls
59 lines (58 loc) · 1.73 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
services:
mongo:
image: mongo:7.0
container_name: mongo
restart: unless-stopped # always restart unless stopped manually
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME:-root}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD:-root}
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
interval: 10s
timeout: 5s
retries: 5
# Application
app:
build:
context: .
dockerfile: Dockerfile
labels:
org.opencontainers.image.authors: "ahmedshahriar <ahmed.shahriar.sakib@gmail.com>"
org.opencontainers.image.licenses: "Apache-2.0"
org.opencontainers.image.source: "https://github.com/ahmedshahriar/restaurant-menu-pricing"
container_name: app
restart: unless-stopped # always restart unless stopped manually
depends_on:
mongo:
condition: service_healthy
env_file:
- .env # loads environment variables into the container
volumes:
- ./.env:/app/.env:ro # makes /app/.env exist for `dotenv run`
working_dir: /app
# For live editing, uncomment the bind mount:
# volumes:
# - ./:/app
command: ["bash","-lc","sleep infinity"]
stdin_open: true
tty: true
# Azure CLI with ML and application-insights extensions
tools:
build:
context: .
dockerfile: Dockerfile.tools
container_name: az
environment:
- AZURE_EXTENSION_DIR=/usr/local/az-extensions
# Persist Azure CLI login locally (optional)
volumes:
- ./_azure:/root/.azure
env_file:
- .env
command: ["bash","-lc","sleep infinity"]
volumes:
mongo-data: