forked from tinkerbell/tink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
125 lines (120 loc) · 3.01 KB
/
docker-compose.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: "3.8"
services:
##### Actual services first #####
db:
image: postgres:14-alpine
environment:
POSTGRES_DB: tinkerbell
POSTGRES_PASSWORD: tinkerbell
POSTGRES_USER: tinkerbell
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- 5432:5432
deploy:
resources:
limits:
cpus: "0.50"
memory: "512M"
healthcheck:
test:
- CMD-SHELL
- pg_isready -U tinkerbell
interval: 1s
timeout: 1s
retries: 30
restart: unless-stopped
tink-server:
build:
context: ./cmd/tink-server/
dockerfile: Dockerfile
environment:
FACILITY: ${FACILITY:-onprem}
PACKET_ENV: ${PACKET_ENV:-testing}
PACKET_VERSION: ${PACKET_VERSION:-ignored}
PGDATABASE: tinkerbell
PGHOST: db
PGPASSWORD: tinkerbell
PGPORT: 5432
PGSSLMODE: disable
PGUSER: tinkerbell
ROLLBAR_DISABLE: ${ROLLBAR_DISABLE:-1}
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-ignored}
TINKERBELL_GRPC_AUTHORITY: :42113
TINKERBELL_HTTP_AUTHORITY: :42114
TINKERBELL_TLS: ${TINKERBERLL_TLS:-"true"}
volumes:
- certs:/certs/${FACILITY:-onprem}:ro
ports:
- 42113:42113/tcp
- 42114:42114/tcp
depends_on:
db:
condition: service_healthy
generate-tls-certs:
condition: service_completed_successfully
db-migrations:
condition: service_completed_successfully
deploy:
resources:
limits:
cpus: "0.50"
memory: "512M"
healthcheck:
# port needs to match TINKERBELL_HTTP_AUTHORITY
test:
- CMD-SHELL
- wget -qO- 127.0.0.1:42114/healthz
interval: 5s
timeout: 2s
retries: 30
restart: unless-stopped
##### One-off setup processes #####
db-migrations:
build:
context: ./cmd/tink-server/
dockerfile: Dockerfile
environment:
FACILITY: ${FACILITY:-onprem}
ONLY_MIGRATION: "true"
PGDATABASE: tinkerbell
PGHOST: db
PGPASSWORD: tinkerbell
PGPORT: 5432
PGSSLMODE: disable
PGUSER: tinkerbell
TINKERBELL_GRPC_AUTHORITY: :42113
TINKERBELL_HTTP_AUTHORITY: :42114
TINKERBELL_TLS: ${TINKERBERLL_TLS:-"true"}
depends_on:
db:
condition: service_healthy
restart: on-failure
generate-tls-certs:
image: cfssl/cfssl
entrypoint: /app/generate.sh
environment:
FACILITY: ${FACILITY:-onprem}
volumes:
- certs:/certs/${FACILITY:-onprem}
- ./deploy/generate-tls-certs/:/app:ro
##### Debugging/interactive commands #####
tink-cli:
build:
context: ./cmd/tink-cli/
dockerfile: Dockerfile
environment:
TINKERBELL_GRPC_AUTHORITY: tink-server:42113
TINKERBELL_TLS: ${TINKERBERLL_TLS:-"true"}
depends_on:
tink-server:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.50"
memory: "512M"
restart: unless-stopped
volumes:
certs:
postgres_data: