-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
91 lines (91 loc) · 2.41 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
version: "3.8"
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.2
# Enables the web UI and tells Traefik to listen to docker
command:
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedByDefault=false"
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
postgres-account:
image: "postgres:alpine"
environment:
- POSTGRES_PASSWORD=password
ports:
- "5432:5432"
# Set a volume for data and initial sql script
# May configure initial db for future demo
volumes:
- "pgdata_account:/var/lib/postgresql/data"
# - ./init:/docker-entrypoint-initdb.d/
command: [ "postgres", "-c", "log_statement=all" ]
redis-account:
image: "redis:alpine"
ports:
- "6379:6379"
volumes:
- "redisdata:/data"
gamesite:
build:
context: .
target: builder
image: gamesite
env_file:
- .env
expose:
- "8080"
labels:
- "traefik.enable=true"
- "traefik.http.routers.account.rule=Host(`eugenes.world`) && PathPrefix(`/api/account`)"
environment:
- ENV=dev
volumes:
- .:/github.com/fshmidt/game-site
depends_on:
- postgres-account
- redis-account
- reverse-proxy
# have to use $$ (double-dollar) so docker doesn't try to substitute a variable
command: reflex -r "\.go$$" -s -- sh -c "go run ./cmd/"
account-client:
build:
context: ./account-client
image: account-client # if we don't give image name, traefik won't create router 🤷♂️
expose:
- "3000"
ports:
- "3000:3000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.account-client.rule=Host(`eugenes.world`) && PathPrefix(`/account`)"
volumes:
- ./account-client:/app
depends_on:
- reverse-proxy
parallax:
build:
context: ./parallax
image: parallax
expose:
- "8090"
ports:
- "8090:8090"
labels:
- "traefik.enable=true"
- "traefik.http.routers.parallax.rule=Host(`eugenes.world`) && PathPrefix(`/`)"
volumes:
- ./parallax:/usr/share/nginx/html
depends_on:
- reverse-proxy
volumes:
pgdata_account:
redisdata: