forked from MarkUsProject/Markus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
168 lines (157 loc) · 4 KB
/
docker-compose-prod.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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
version: '3.7'
services:
app: &app
build:
context: .
dockerfile: ./.dockerfiles/Dockerfile
target: prod
args:
UBUNTU_VERSION: bionic
RUBY_VERSION: '2.7'
PG_MAJOR: '12'
NODE_MAJOR: '12'
YARN_VERSION: '1.22.5'
BUNDLER_VERSION: '1.17.3'
PYTHON_VERSION: '3.9'
USER: 'markus'
image: markus:1.0.0
tmpfs:
- /tmp
stdin_open: true
tty: true
entrypoint: .dockerfiles/production_demo/entrypoint-prod-rails.sh
depends_on:
- postgres
- redis
ssh:
build:
context: .
dockerfile: ./.dockerfiles/Dockerfile-ssh
args:
UBUNTU_VERSION: bionic
SSH_USER: git
image: markus-ssh:1.0.0
volumes:
- repos_108:/home/git/csc108
- repos_209:/home/git/csc209
environment:
- TZ=America/Toronto
command: /usr/sbin/sshd -D -e
ports:
- '2222:22'
rails_108: &rails_108
<<: *app
command: bundle exec rails server -b 0.0.0.0
environment:
- RAILS_RELATIVE_URL_ROOT=/csc108
- PGDATABASE=markus-csc108
- PGDATABASETEST=markus-csc108-test
- SECRET_KEY_BASE=1 # change this to something secure and/or use a secret to set this
- PGUSER=postgres
- PGHOST=postgres
- PGPASSWORD=docker # change this to something secure and/or use a secret to set this
- TZ=America/Toronto
ports:
- '3000:3000'
volumes:
- app_data_108:/app/data/prod
- repos_108:/app/data/prod/repos
- log_108:/app/log
- assets_108:/app/public
secrets:
- source: csc108.settings
target: /app/config/settings.local.yml
depends_on:
- postgres
- redis
- resque_108
- ssh
resque_108:
<<: *rails_108
command: bundle exec rails resque:work QUEUE=* TERM_CHILD=1
depends_on:
- redis
ports: []
rails_209: &rails_209
<<: *app
command: bundle exec rails server -b 0.0.0.0
environment:
- RAILS_RELATIVE_URL_ROOT=/csc209
- PGDATABASE=markus-csc209
- PGDATABASETEST=markus-csc209-test
- SECRET_KEY_BASE=1 # change this to something secure and/or use a secret to set this
- PGUSER=postgres
- PGHOST=postgres
- PGPASSWORD=docker # change this to something secure and/or use a secret to set this
- TZ=America/Toronto
ports:
- '3001:3000'
volumes:
- app_data_209:/app/data/prod
- repos_209:/app/data/prod/repos
- log_209:/app/log
- assets_209:/app/public
secrets:
- source: csc209.settings
target: /app/config/settings.local.yml
depends_on:
- postgres
- redis
- resque_209
- ssh
resque_209:
<<: *rails_209
command: bundle exec rails resque:work QUEUE=* TERM_CHILD=1
depends_on:
- redis
ports: []
postgres:
image: postgres:10
volumes:
- postgres:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=docker # change this to something secure and/or use a secret to set this
- POSTGRES_INITDB_ARGS="-A md5"
redis:
image: redis:3.2-alpine
volumes:
- redis:/data
ports:
- 6379
httpd:
build:
context: ./.dockerfiles/production_demo
dockerfile: ./Dockerfile-httpd
ports:
- '8080:80'
volumes:
- assets_108:/assets/csc108
- assets_209:/assets/csc209
- repos_108:/repos/csc108
- repos_209:/repos/csc209
depends_on:
- rails_108
- rails_209
secrets:
- source: markus.conf
target: /usr/local/apache2/sites-enabled/markus.conf
- source: validategit
target: /auth/validategit
volumes:
app_data_108:
repos_108:
log_108:
assets_108:
app_data_209:
repos_209:
log_209:
assets_209:
postgres:
redis:
secrets:
markus.conf:
file: ./.dockerfiles/production_demo/httpd.example.conf
csc108.settings:
file: ./.dockerfiles/production_demo/csc108.settings.example.yml
csc209.settings:
file: ./.dockerfiles/production_demo/csc209.settings.example.yml