-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (74 loc) · 1.95 KB
/
Copy pathdocker-compose.yml
File metadata and controls
76 lines (74 loc) · 1.95 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# TODO: add testing, preferably via profiles (https://docs.docker.com/compose/how-tos/profiles/)
services:
podinfo:
develop:
watch:
- action: rebuild
path: ./src
- action: sync+restart
path: ./proxy/nginx.conf
target: /etc/nginx/conf.d/default.conf
build:
context: .
dockerfile: Dockerfile
# CI/CD uses sha tags, but for local development we can just use latest
image: podinfo-js:latest
container_name: podinfo-js
depends_on:
redis:
condition: service_healthy
restart: true
restart: unless-stopped
ports:
- "3000:3000"
environment:
PORT: 3000
HOST: 0.0.0.0
LOG_LEVEL: info
MESSAGE: "greetings from podinfo-node"
APP_VERSION: "0.1.0"
SECRETS_DIR: /etc/secrets
REDIS_ENABLED: 'true'
REDIS_HOST: redis
REDIS_PORT: 6379
# Simple way to provide secrets, can dynamically add secrets by adding files to ./secrets dir
volumes:
- type: bind
source: ./secrets
target: /etc/secrets
read_only: true
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
redis:
image: redis:latest
container_name: redis
ports:
- '6379:6379'
# environment:
# - REDIS_ARGS=--requirepass <password> --appendonly yes
restart: unless-stopped
healthcheck:
test: ["CMD","redis-cli", "ping"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
# Alternative way to provide secrets, can't dynamically add secrets by plopping files in ./secrets dir
# secrets:
# - db-password
# - api-key
# secrets:
# db-password:
# file: ./secrets/db-password
# api-key:
# file: ./secrets/api-key