-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
74 lines (66 loc) · 2.19 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
72
73
74
version: '3.9'
networks:
traefik-proxy:
external: true
postgres-database:
external: true
services:
traefik:
image: traefik:latest
container_name: traefik
restart: always
labels:
- traefik.enable=true
- traefik.http.services.traefik.loadbalancer.server.port=8080
- traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN}`)
- traefik.http.routers.traefik.entrypoints=web-secure
- traefik.http.routers.traefik.tls.certresolver=letsencrypt
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik.middlewares=traefik-auth
- traefik.http.middlewares.traefik-auth.basicauth.users=admin:$$2y$$05$$JDcoUpjjQEbKlmFxIMJxiOYXA//6EOUoLlEvOUhmmFyTaD9AiM1Cy #admin:adminadmin
- traefik.docker.network=traefik-proxy
ports:
- "80:80" # The HTTP port
- "443:443" # The HTTPS port
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik/traefik.yaml:/traefik.yaml
- ./config/traefik/certs/acme.json:/acme.json
networks:
- traefik-proxy
postgres:
image: postgres:alpine
container_name: postgres
restart: always
expose:
- 5432
networks:
- postgres-database
environment:
TZ: 'Europe/Moscow'
PGTZ: 'Europe/Moscow'
POSTGRES_PASSWORD: 'efX579io2qDqajZU1'
POSTGRES_USER: 'mydatabase'
volumes:
- ./data/postgres:/var/lib/postgresql/data/
- ./config/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
restart: always
networks:
- postgres-database
- traefik-proxy
environment:
PGADMIN_DEFAULT_EMAIL: pgadmin@example.com
PGADMIN_DEFAULT_PASSWORD: efX579io2qDqajZU1
volumes:
- ./data/pgadmin:/var/lib/pgadmin
labels:
- traefik.enable=true
- traefik.http.routers.pgadmin.entrypoints=web-secure
- traefik.http.routers.pgadmin.rule=Host(`pgadmin.${DOMAIN}`)
- traefik.http.routers.pgadmin.tls.certresolver=letsencrypt
- traefik.http.services.pgadmin.loadbalancer.server.port=80
- traefik.docker.network=traefik-proxy