This repository has been archived by the owner on Oct 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
54 lines (51 loc) · 1.66 KB
/
docker-compose.yml
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
version: "3.7"
services:
proxy:
image: traefik:latest
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
# Endpoints setup
- "--entrypoints.postgres.address=:5432" # PostgreSQL endpoint
- "--entrypoints.redis.address=:6379" # Redis endpoint
ports:
- "6969:8080" # Traefik dashboard
- "5432:5432" # PostgreSQL port
- "6379:6379" # Redis port
volumes:
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: postgres
restart: always
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
volumes:
- ./appdata/postgres:/var/lib/postgresql/data
labels:
- "traefik.enable=true"
# routers
- "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
- "traefik.tcp.routers.postgres.entryPoints=postgres"
- "traefik.tcp.routers.postgres.service=postgres"
# services (needed for TCP)
- "traefik.tcp.services.postgres.loadbalancer.server.port=5432"
redis:
image: bitnami/redis:latest
restart: always
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
volumes:
- ./appdata/redis:/bitnami/redis/data
labels:
- "traefik.enable=true"
# routers
- "traefik.tcp.routers.redis.rule=HostSNI(`*`)"
- "traefik.tcp.routers.redis.entryPoints=redis"
- "traefik.tcp.routers.redis.service=redis"
# services (needed for TCP)
- "traefik.tcp.services.redis.loadbalancer.server.port=6379"