-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
117 lines (111 loc) · 3.27 KB
/
Copy pathcompose.yaml
File metadata and controls
117 lines (111 loc) · 3.27 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
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
name: the-search
services:
database:
image: the-search-database:local
build:
context: ./database
platform: linux/amd64
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${THE_SEARCH_DATABASE_ADMIN_PASSWORD:-local-admin-only}
POSTGRES_DB: the_search
THE_SEARCH_MIGRATOR_PASSWORD: ${THE_SEARCH_DATABASE_MIGRATOR_PASSWORD:-local-migrator-only}
THE_SEARCH_APPLICATION_PASSWORD: ${THE_SEARCH_DATABASE_APPLICATION_PASSWORD:-local-app-only}
ports:
- "127.0.0.1:${THE_SEARCH_DATABASE_PORT:-5432}:5432"
volumes:
- database-data:/var/lib/postgresql
- ./database/init/20-the-search-roles.sh:/docker-entrypoint-initdb.d/20-the-search-roles.sh:ro
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m
- /var/run/postgresql:rw,noexec,nosuid,uid=70,gid=70,mode=3775,size=16m
read_only: true
shm_size: 128mb
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD-SHELL", "pg_isready --username=$${POSTGRES_USER} --dbname=$${POSTGRES_DB}"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
stop_grace_period: 30s
migrate:
image: the-search-migrate:local
build:
context: ./backend
target: migration
command:
- up
environment:
MIGRATION_DATABASE_URL: postgres://the_search_migrator:${THE_SEARCH_DATABASE_MIGRATOR_PASSWORD:-local-migrator-only}@database:5432/the_search?sslmode=disable
MIGRATION_TIMEOUT: 2m
depends_on:
database:
condition: service_healthy
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
restart: "no"
bootstrap:
image: the-search-bootstrap:local
build:
context: ./backend
target: bootstrap
environment:
BOOTSTRAP_DATABASE_URL: postgres://the_search_migrator:${THE_SEARCH_DATABASE_MIGRATOR_PASSWORD:-local-migrator-only}@database:5432/the_search?sslmode=disable
BOOTSTRAP_PRINCIPAL_ID: ${THE_SEARCH_BOOTSTRAP_PRINCIPAL_ID:-2f404f62-3d6f-4e5f-a2e8-1be44b08f05c}
BOOTSTRAP_TIMEOUT: 30s
depends_on:
migrate:
condition: service_completed_successfully
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
restart: "no"
api:
image: the-search-api:local
build:
context: ./backend
target: api
args:
VERSION: local
COMMIT: development
environment:
HTTP_ADDRESS: :8080
DATABASE_URL: postgres://the_search_app:${THE_SEARCH_DATABASE_APPLICATION_PASSWORD:-local-app-only}@database:5432/the_search?sslmode=disable
BOOTSTRAP_PRINCIPAL_ID: ${THE_SEARCH_BOOTSTRAP_PRINCIPAL_ID:-2f404f62-3d6f-4e5f-a2e8-1be44b08f05c}
depends_on:
bootstrap:
condition: service_completed_successfully
ports:
- "127.0.0.1:8080:8080"
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
pwa:
image: the-search-pwa:local
build:
context: ./frontend
depends_on:
api:
condition: service_healthy
ports:
- "127.0.0.1:8081:8080"
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
volumes:
database-data: