質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,10 +2,108 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
```
|
6
|
+
|
5
|
-
|
7
|
+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
8
|
+
|
9
|
+
```
|
6
10
|
|
7
11
|
|
8
12
|
|
9
13
|
[Docker-docs-ja](https://docs.docker.jp/engine/reference/builder.html#copy)や[公式ドキュメント](https://matsuand.github.io/docs.docker.jp.onthefly/develop/develop-images/multistage-build/)を参照してみたのですが、いまいち「ビルドステージ」という意味も分かりませんでした。
|
10
14
|
|
11
15
|
どなたか、お手数ですがご助言頂けましたら幸いです。
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
### 追記です
|
20
|
+
|
21
|
+
以下は、Dockerfileの全文になります。こちらのDockerfileは[Qiita](https://qiita.com/ucan-lab/items/5fc1281cd8076c8ac9f4#comment-b2e3820d2dbd9aebcd69)
|
22
|
+
|
23
|
+
の記事内で紹介されていた内容のものになります。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
FROM php:7.4-fpm-buster
|
32
|
+
|
33
|
+
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
# timezone environment
|
38
|
+
|
39
|
+
ENV TZ=UTC \
|
40
|
+
|
41
|
+
# locale
|
42
|
+
|
43
|
+
LANG=en_US.UTF-8 \
|
44
|
+
|
45
|
+
LANGUAGE=en_US:en \
|
46
|
+
|
47
|
+
LC_ALL=en_US.UTF-8 \
|
48
|
+
|
49
|
+
# composer environment
|
50
|
+
|
51
|
+
COMPOSER_ALLOW_SUPERUSER=1 \
|
52
|
+
|
53
|
+
COMPOSER_HOME=/composer \
|
54
|
+
|
55
|
+
# Laravel environment
|
56
|
+
|
57
|
+
DB_CONNECTION=mysql \
|
58
|
+
|
59
|
+
DB_HOST=db \
|
60
|
+
|
61
|
+
DB_DATABASE=laravel_local \
|
62
|
+
|
63
|
+
DB_USERNAME=phper \
|
64
|
+
|
65
|
+
DB_PASSWORD=secret
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
RUN apt-get update && \
|
74
|
+
|
75
|
+
apt-get -y install git libicu-dev libonig-dev libzip-dev unzip locales && \
|
76
|
+
|
77
|
+
apt-get clean && \
|
78
|
+
|
79
|
+
rm -rf /var/lib/apt/lists/* && \
|
80
|
+
|
81
|
+
locale-gen en_US.UTF-8 && \
|
82
|
+
|
83
|
+
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
|
84
|
+
|
85
|
+
mkdir /var/run/php-fpm && \
|
86
|
+
|
87
|
+
mkdir /var/log/php && \
|
88
|
+
|
89
|
+
docker-php-ext-install intl pdo_mysql mbstring zip bcmath && \
|
90
|
+
|
91
|
+
composer config -g process-timeout 3600 && \
|
92
|
+
|
93
|
+
composer config -g repos.packagist composer https://packagist.jp && \
|
94
|
+
|
95
|
+
composer global require hirak/prestissimo
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
COPY ./php-fpm.d/zzz-www.conf /usr/local/etc/php-fpm.d/zzz-www.conf
|
100
|
+
|
101
|
+
COPY ./php.ini /usr/local/etc/php/php.ini
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
WORKDIR /work/backend
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
```
|
1
タイトル修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
マルチステージビルド
|
1
|
+
マルチステージビルドについて
|
test
CHANGED
File without changes
|