質問編集履歴

2

docker-composeファイル、Dockerfile記載

2019/07/11 08:19

投稿

love_with_torte
love_with_torte

スコア12

test CHANGED
File without changes
test CHANGED
@@ -46,6 +46,10 @@
46
46
 
47
47
 
48
48
 
49
+ #### 環境について
50
+
51
+
52
+
49
53
  - ホスト環境
50
54
 
51
55
  Windows10 Pro
@@ -66,6 +70,250 @@
66
70
 
67
71
 
68
72
 
73
+ #### docker-composeファイル
74
+
75
+
76
+
77
+ ```Docker:docker-compose
78
+
79
+ version: '3'
80
+
81
+
82
+
83
+ volumes:
84
+
85
+ mariadb_data:
86
+
87
+
88
+
89
+ services:
90
+
91
+ nginx:
92
+
93
+ build: ./nginx
94
+
95
+ # command: nginx -g daemon off;
96
+
97
+ command: /sbin/init
98
+
99
+ container_name: nginx
100
+
101
+ depends_on:
102
+
103
+ - django
104
+
105
+ privileged: true
106
+
107
+ ports:
108
+
109
+ - 80:80
110
+
111
+ volumes:
112
+
113
+ - ./path/to/conf.d:/path/to/conf.d
114
+
115
+ - ./path/to/log:/path/to/log/nginx
116
+
117
+
118
+
119
+ django:
120
+
121
+ build: ./django
122
+
123
+ container_name: django
124
+
125
+ # command: uwsgi --ini /path/to/django.ini
126
+
127
+ command: /sbin/init
128
+
129
+ depends_on:
130
+
131
+ - mariadb
132
+
133
+ env_file:
134
+
135
+ - ./path/to/django/.django.env
136
+
137
+ expose:
138
+
139
+ - "32788"
140
+
141
+ privileged: true
142
+
143
+ volumes:
144
+
145
+ - ./path/to/django/src:/path/to
146
+
147
+
148
+
149
+ mariadb:
150
+
151
+ build: ./mariadb
152
+
153
+ # command: mysqld
154
+
155
+ command: /sbin/init
156
+
157
+ container_name: mariadb
158
+
159
+ env_file:
160
+
161
+ - ./path/to/mariadb/.mariadb.env
162
+
163
+ privileged: true
164
+
165
+ ports:
166
+
167
+ - "3306:3306"
168
+
169
+ volumes:
170
+
171
+ # データを永続化させる
172
+
173
+ - mariadb_data:/path/to/mysql
174
+
175
+
176
+
177
+ # postfix:
178
+
179
+
180
+
181
+ # dovecot:
182
+
183
+
184
+
185
+ ```
186
+
187
+
188
+
189
+ #### Dockerfile
190
+
191
+
192
+
193
+ ##### nginx
194
+
195
+
196
+
197
+ ```Docker:nginx
198
+
199
+ FROM centos:7
200
+
201
+
202
+
203
+ RUN yum update -y && \
204
+
205
+ yum clean all
206
+
207
+
208
+
209
+ COPY ./path/to/nginx.repo.backup /path/to/nginx.repo
210
+
211
+
212
+
213
+ COPY ./path/to/morix_nginx.conf /path/to/place/morix_nginx.conf
214
+
215
+
216
+
217
+ COPY ./path/to/django_uwsgi_params /path/to/django_uwsgi_params
218
+
219
+
220
+
221
+ RUN yum install -y epel-release && \
222
+
223
+ yum install -y less which vim && \
224
+
225
+ yum install -y nginx && \
226
+
227
+ yum clean all && \
228
+
229
+ systemctl enable nginx
230
+
231
+
232
+
233
+ ```
234
+
235
+
236
+
237
+ ##### django
238
+
239
+
240
+
241
+ ```Docker:django
242
+
243
+ FROM centos:7
244
+
245
+
246
+
247
+ ENV python="/usr/bin/python3.6"
248
+
249
+ ENV pip="/usr/bin/python3.6 -m pip"
250
+
251
+
252
+
253
+ RUN yum update -y && \
254
+
255
+ yum clean all
256
+
257
+
258
+
259
+ RUN yum install -y epel-release && \
260
+
261
+ yum install -y less which vim gcc && \
262
+
263
+ yum install -y https://centos7.iuscommunity.org/ius-release.rpm && \
264
+
265
+ yum install -y python36u python36u-libs python36u-devel python36u-pip && \
266
+
267
+ ${pip} install --upgrade pip && \
268
+
269
+ ${pip} install django==2.1.* django-cleanup uwsgi pillow pymysql && \
270
+
271
+ yum clean all
272
+
273
+
274
+
275
+ EXPOSE 32788
276
+
277
+
278
+
279
+ ```
280
+
281
+
282
+
283
+ ##### mariadb
284
+
285
+
286
+
287
+ ```Docker:mariadb
288
+
289
+ FROM centos:7
290
+
291
+
292
+
293
+ RUN yum update -y && \
294
+
295
+ yum clean all
296
+
297
+
298
+
299
+ COPY ./path/to/mariadb-init.sql /path/to/mariadb-init.sql
300
+
301
+
302
+
303
+ RUN yum install -y less which vim && \
304
+
305
+ curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version=mariadb-10.3 && \
306
+
307
+ yum install -y MariaDB-server galera MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common && \
308
+
309
+ systemctl enable mariadb
310
+
311
+
312
+
313
+ ```
314
+
315
+
316
+
69
317
  補足情報足りていなければ
70
318
 
71
319
  コメントお願い致します。

1

目的を更新

2019/07/11 08:19

投稿

love_with_torte
love_with_torte

スコア12

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,9 @@
24
24
 
25
25
  強制的にVMの電源を落として対応しているのですが
26
26
 
27
- これが出ないようにしたいです。
27
+ ~~これが出ないようにしたいです。~~
28
+
29
+ CentOSから入力をUbuntuに戻したいです。
28
30
 
29
31
 
30
32