質問編集履歴
1
henkou
test
CHANGED
File without changes
|
test
CHANGED
@@ -257,3 +257,175 @@
|
|
257
257
|
|
258
258
|
|
259
259
|
```
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
Laravelプロジェクトの入っているコンテナのDcokerfileとdocker-compose.yml
|
264
|
+
|
265
|
+
```
|
266
|
+
|
267
|
+
version: '3'
|
268
|
+
|
269
|
+
services:
|
270
|
+
|
271
|
+
web:
|
272
|
+
|
273
|
+
build:
|
274
|
+
|
275
|
+
context: "./"
|
276
|
+
|
277
|
+
dockerfile: ./Dockerfile
|
278
|
+
|
279
|
+
container_name: "cms"
|
280
|
+
|
281
|
+
command: "/sbin/init"
|
282
|
+
|
283
|
+
volumes:
|
284
|
+
|
285
|
+
- ./html:/var/www/html
|
286
|
+
|
287
|
+
- ./nginx/conf.d:/etc/nginx/conf.d/
|
288
|
+
|
289
|
+
- ./php/php.ini:/etc/php.ini
|
290
|
+
|
291
|
+
- ./php-fpm/www.conf:/etc/php-fpm.d/www.conf
|
292
|
+
|
293
|
+
- ./supervisor/supervisord.conf:/etc/supervisord.conf
|
294
|
+
|
295
|
+
- /Users/user/dev/cms:/var/www/
|
296
|
+
|
297
|
+
ports:
|
298
|
+
|
299
|
+
- 90:80
|
300
|
+
|
301
|
+
environment:
|
302
|
+
|
303
|
+
- VIRTUAL_HOST=cms.local.jp
|
304
|
+
|
305
|
+
tty: true
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
networks:
|
310
|
+
|
311
|
+
default:
|
312
|
+
|
313
|
+
external:
|
314
|
+
|
315
|
+
name: common_link
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
```
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
```
|
324
|
+
|
325
|
+
FROM amazonlinux:1
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
RUN rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi &&\
|
332
|
+
|
333
|
+
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && \
|
334
|
+
|
335
|
+
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
RUN yum update -y
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
RUN yum install -y \
|
344
|
+
|
345
|
+
initscripts \
|
346
|
+
|
347
|
+
sudo \
|
348
|
+
|
349
|
+
git \
|
350
|
+
|
351
|
+
zip \
|
352
|
+
|
353
|
+
unzip \
|
354
|
+
|
355
|
+
nginx --skip-broken \
|
356
|
+
|
357
|
+
httpd \
|
358
|
+
|
359
|
+
wget \
|
360
|
+
|
361
|
+
less \
|
362
|
+
|
363
|
+
libxslt \
|
364
|
+
|
365
|
+
automake \
|
366
|
+
|
367
|
+
autoconf \
|
368
|
+
|
369
|
+
mysql \
|
370
|
+
|
371
|
+
libmcrypt \
|
372
|
+
|
373
|
+
libtool-ltdl \
|
374
|
+
|
375
|
+
gcc gcc-c++
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
# TODO: supervisorのインストール
|
380
|
+
|
381
|
+
# コンテナの構築後に supervisord コマンドを実行してプロセスを起動させる
|
382
|
+
|
383
|
+
# RUN yum install -y python27-setuptools.noarch &&\
|
384
|
+
|
385
|
+
# easy_install pip &&\
|
386
|
+
|
387
|
+
# pip install supervisor --install-option="--install-scripts=/usr/bin"
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
RUN yum install -y --disablerepo=amzn-main,amzn-updates --enablerepo=remi,remi-php71 \
|
392
|
+
|
393
|
+
php php-devel php-common php-mbstring php-pdo php-xml php-fpm php-mysql php-soap php-mcrypt
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
RUN touch /etc/sysconfig/network
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
RUN useradd docker
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
RUN service nginx start &&\
|
406
|
+
|
407
|
+
service php-fpm start &&\
|
408
|
+
|
409
|
+
service iptables stop
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
RUN chkconfig nginx on &&\
|
414
|
+
|
415
|
+
chkconfig php-fpm on &&\
|
416
|
+
|
417
|
+
chkconfig iptables off
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
RUN chown -R root:nginx /var/log/nginx
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
RUN chmod -R 770 /var/log/nginx/
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
CMD ["nginx", "-g", "daemon off;"]
|
430
|
+
|
431
|
+
```
|