-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
71 lines (64 loc) · 2.52 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
version: '3.5'
#
# [IMPORTANT] `container_name` properties are prefixed by the project name to avoid conflicting with other project volumes
#
services:
postgres:
container_name: mediature_postgres_container_${DOCKER_COMPOSE_CONTAINER_NAME_SUFFIX:-default}
image: postgres:14.6
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- '127.0.0.1:${DOCKER_COMPOSE_HOST_PORTS:-5432:}5432'
networks:
- postgres
restart: unless-stopped
healthcheck:
# Note: at start we tried `pg_isready` but it's not efficient since the postgres container restarts the server at startup (to init some scripts) so we ended with broken connections...
# The best is to try a real query to be sure it's up and running as advised in https://github.com/docker-library/postgres/issues/146#issuecomment-872486465
test: ['CMD-SHELL', 'psql -h localhost -U $${POSTGRES_USER} -c select 1 -d $${POSTGRES_DB}']
interval: 1s
timeout: 3s
retries: 5
pgadmin:
container_name: mediature_pgadmin_container_${DOCKER_COMPOSE_CONTAINER_NAME_SUFFIX:-default}
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- '127.0.0.1:${DOCKER_COMPOSE_HOST_PORTS:-5050:}80'
networks:
- postgres
restart: unless-stopped
mailcatcher:
container_name: mediature_mailcatcher_container_${DOCKER_COMPOSE_CONTAINER_NAME_SUFFIX:-default}
image: aerzas/mailcatcher:2.0.1
environment:
EMAIL_HOST: ${EMAIL_HOST:-127.0.0.1}
EMAIL_HOST_USER: ${EMAIL_HOST_USER:-}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD:-}
EMAIL_PORT: ${EMAIL_PORT:-1025}
ports:
- '127.0.0.1:${DOCKER_COMPOSE_HOST_PORTS:-1080:}1080'
- '127.0.0.1:${DOCKER_COMPOSE_HOST_PORTS:-11025:}1025' # We set `11025` on the host because we had the case where a local email software had taken this port already and Docker didn't warn us (it was really tricky to find the cause...)
restart: unless-stopped
healthcheck:
test: ['CMD', '/scripts/docker-healthcheck.sh']
interval: 1s
timeout: 3s
retries: 5
networks:
postgres:
driver: bridge
volumes:
postgres:
pgadmin: