-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
66 lines (64 loc) · 2.06 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
version: '3.8'
services:
postgres:
build:
context: ./compose/postgres
args:
- BASEIMAGE=${POSTGRES_BASE_IMAGE}
image: ${POSTGRES_REFINED_IMAGE}:${STACK_VERSION}
container_name: ${STACK_NAME:-defstack}_postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.postgres.tls=false"
- "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
# the following filter does not work here as HostSNI is a TLS concept
# - "traefik.tcp.routers.postgres.tls=true"
# - "traefik.tcp.routers.postgres.rule=HostSNI(`postgres.${DOMAIN_NAME}`)"
- "traefik.tcp.routers.postgres.entrypoints=db"
- "traefik.tcp.routers.postgres.service=postgres"
- "traefik.tcp.services.postgres.loadbalancer.server.port=5432"
command: [ "postgres", "-c", "wal_level=logical" ]
ports:
- "${POSTGRES_PORT}:5432"
networks:
- mydefaultstack
volumes:
- postgres_data:/var/lib/postgresql/data
pgadmin:
image: ${PGADMIN_BASE_IMAGE}
container_name: ${STACK_NAME:-defstack}_pgadmin
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:-admin}
- PGADMIN_CONFIG_SERVER_MODE=False
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgadmin.tls=true"
- "traefik.http.routers.pgadmin.rule=Host(`pgadmin.${DOMAIN_NAME}`)"
- "traefik.http.services.pgadmin.loadbalancer.server.port=80"
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- mydefaultstack
volumes:
- pgadmin:/var/lib/pgadmin
logging:
driver: none
volumes:
postgres_data:
driver: local
#external: true
name: ${STACK_NAME:-defstack}_postgres-db
pgadmin:
driver: local
#external: true
name: ${STACK_NAME:-defstack}_pgadmin-config
networks:
mydefaultstack:
name: mydefaultstack
external: true