-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
148 lines (147 loc) · 3.47 KB
/
compose.yaml
File metadata and controls
148 lines (147 loc) · 3.47 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Docker compose reference guide at
# https://docs.docker.com/go/compose-spec-reference/
# Here the instructions define your application as a service called "server".
# This service is built from the Dockerfile in the current directory.
# You can add other services your application may depend on here, such as a
# database or a cache. For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
blog:
restart: always
image: 'soulike/blog:latest'
depends_on:
- blog-server
networks:
- blog
admin:
restart: always
image: 'soulike/admin:latest'
depends_on:
- admin-server
networks:
- admin
game-2048:
restart: always
image: 'soulike/game-2048:latest'
networks:
- game-2048
auth-server:
restart: always
image: 'soulike/auth-server:latest'
secrets:
- redis-password
- db-password
environment:
- REDIS_PASSWORD_FILE=/run/secrets/redis-password
- DB_PASSWORD_FILE=/run/secrets/db-password
depends_on:
- redis
- database-server
networks:
- auth
- redis
- database
admin-server:
restart: always
image: 'soulike/admin-server-legacy:latest'
volumes:
- $HOME/.blog-data:/.blog-data
secrets:
- redis-password
environment:
- REDIS_PASSWORD_FILE=/run/secrets/redis-password
depends_on:
- redis
- database-server
networks:
- admin
- redis
- database
blog-server:
restart: always
image: 'soulike/blog-server-legacy:latest'
volumes:
- $HOME/.blog-data:/.blog-data:ro
depends_on:
- database-server
networks:
- blog
- database
database-server:
restart: always
image: 'soulike/database-server-legacy:latest'
secrets:
- db-password
environment:
- DB_PASSWORD_FILE=/run/secrets/db-password
depends_on:
- db
networks:
- database # Database shall never be exposed with other networks for safety
nginx:
restart: always
image: 'soulike/website-nginx:latest'
depends_on:
- blog
- admin
- game-2048
- auth-server
- blog-server
- admin-server
volumes:
- $HOME/ssl:/ssl:ro
logging:
driver: json-file
options:
max-size: '10m'
max-file: '5'
ports:
- '80:80'
- '443:443/tcp'
- '443:443/udp'
networks:
- blog
- admin
- auth
- game-2048
db:
image: postgres:16-alpine
restart: always
secrets:
- db-password
volumes:
- $HOME/website-database/data/16:/var/lib/postgresql/data
environment:
- POSTGRES_USER=soulike
- POSTGRES_DB=website
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
ports:
- '127.0.0.1:5432:5432'
networks:
- database
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER']
interval: 10s
timeout: 5s
retries: 5
redis:
restart: always
image: redis:alpine
secrets:
- redis-password
command: sh -c 'redis-server --requirepass "$$(cat /run/secrets/redis-password)"'
networks:
- redis
networks:
blog:
admin:
auth:
game-2048:
database:
redis:
secrets:
db-password:
file: $HOME/website-database/db-password
redis-password:
file: $HOME/website-database/redis-password