-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgresql.yaml
More file actions
71 lines (63 loc) · 1.54 KB
/
Copy pathpostgresql.yaml
File metadata and controls
71 lines (63 loc) · 1.54 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
# syntax=docker/dockerfile:1
version: "3"
networks:
composes:
services:
postgresql:
container_name: postgresql
hostname: postgresql
restart: always
image: postgres:9.6-alpine
environment:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
networks:
- composes
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
migrations:
hostname: migrations
container_name: migrations
restart: no
image: migrate/migrate:v4.17.1
command: -path=/migrations -database "postgres://root:root@postgresql:5432/test" -verbose up
environment:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
volumes:
- ./migrations/postgresql:/migrations
networks:
- composes
depends_on:
postgresql:
condition: service_healthy
pgadmin:
container_name: pgadmin
hostname: pgadmin
restart: always
image: dpage/pgadmin4:2024-07-25-1
environment:
PGADMIN_DEFAULT_EMAIL: root@domain.com
PGADMIN_DEFAULT_PASSWORD: root
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 8000:8000
networks:
- composes
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "PGPASSWORD=${POSTGRES_PASSWORD} psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -c 'SELECT 1;' || exit 1"]
interval: 10s
timeout: 5s
retries: 5