-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
42 lines (42 loc) · 1.02 KB
/
Copy pathcompose.yaml
File metadata and controls
42 lines (42 loc) · 1.02 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
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: forms
POSTGRES_PASSWORD: forms_local
POSTGRES_DB: forms
ports:
- '127.0.0.1:${FORMS_DATABASE_PORT:-5546}:5432'
volumes:
- forms_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U forms -d forms']
interval: 2s
timeout: 3s
retries: 20
migrate:
build:
context: .
target: migrate
environment:
DATABASE_URL: postgresql://forms:forms_local@postgres:5432/forms?schema=forms
depends_on:
postgres:
condition: service_healthy
api:
build:
context: .
target: runtime
env_file: .env
environment:
DATABASE_URL: postgresql://forms:forms_local@postgres:5432/forms?schema=forms
PORT: 3000
ports:
- '127.0.0.1:${FORMS_HTTP_PORT:-3006}:3000'
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
volumes:
forms_data: