質問編集履歴

2

補足を行った

2020/09/13 16:21

投稿

hiroki88
hiroki88

スコア66

test CHANGED
File without changes
test CHANGED
@@ -277,3 +277,33 @@
277
277
  ちなみに下記のサイトを参考にしました。
278
278
 
279
279
  https://qiita.com/3no3_tw/items/25cb7c0c09d51b56eb5a
280
+
281
+
282
+
283
+ myappの構成を追記しました。
284
+
285
+ myapp
286
+
287
+ -app
288
+
289
+ -bootstrap
290
+
291
+ -config
292
+
293
+ -database
294
+
295
+ -node_modules
296
+
297
+ -public
298
+
299
+ -resources
300
+
301
+ -routes
302
+
303
+ -storage
304
+
305
+ -tests
306
+
307
+ -vender
308
+
309
+ 各種package.json等のファイル

1

追加情報

2020/09/13 16:21

投稿

hiroki88
hiroki88

スコア66

test CHANGED
File without changes
test CHANGED
@@ -105,3 +105,175 @@
105
105
  export default router;
106
106
 
107
107
  ```
108
+
109
+ ```Dokerfile
110
+
111
+ FROM php:7.2-fpm
112
+
113
+ COPY php.ini /usr/local/etc/php/
114
+
115
+
116
+
117
+ RUN apt-get update \
118
+
119
+ && apt-get install -y zlib1g-dev mariadb-client \
120
+
121
+ && docker-php-ext-install zip pdo_mysql
122
+
123
+
124
+
125
+ # nodejs install
126
+
127
+ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
128
+
129
+ RUN apt-get install -y nodejs
130
+
131
+
132
+
133
+ #Composer install
134
+
135
+ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
136
+
137
+ RUN php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
138
+
139
+ RUN php composer-setup.php
140
+
141
+ RUN php -r "unlink('composer-setup.php');"
142
+
143
+ RUN mv composer.phar /usr/local/bin/composer
144
+
145
+
146
+
147
+ ENV COMPOSER_ALLOW_SUPERUSER 1
148
+
149
+
150
+
151
+ ENV COMPOSER_HOME /composer
152
+
153
+
154
+
155
+ ENV PATH $PATH:/composer/vendor/bin
156
+
157
+
158
+
159
+
160
+
161
+ WORKDIR /var/www
162
+
163
+
164
+
165
+ RUN composer global require "laravel/installer"
166
+
167
+ ```
168
+
169
+ ```dokercomposeryml
170
+
171
+ version: '3'
172
+
173
+
174
+
175
+ services:
176
+
177
+ php:
178
+
179
+ container_name: php
180
+
181
+ build: ./docker/php
182
+
183
+ volumes:
184
+
185
+ - ./myapp/:/var/www
186
+
187
+
188
+
189
+ nginx:
190
+
191
+ image: nginx
192
+
193
+ container_name: nginx
194
+
195
+ ports:
196
+
197
+ - 80:80
198
+
199
+ volumes:
200
+
201
+ - ./myapp/:/var/www
202
+
203
+ - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
204
+
205
+ depends_on:
206
+
207
+ - php
208
+
209
+
210
+
211
+ db:
212
+
213
+ image: mysql:5.7
214
+
215
+ container_name: db-host
216
+
217
+ environment:
218
+
219
+ MYSQL_ROOT_PASSWORD: root
220
+
221
+ MYSQL_DATABASE: database
222
+
223
+ MYSQL_USER: docker
224
+
225
+ MYSQL_PASSWORD: docker
226
+
227
+ TZ: 'Asia/Tokyo'
228
+
229
+ command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
230
+
231
+ volumes:
232
+
233
+ - ./docker/db/data:/var/lib/mysql
234
+
235
+ - ./docker/db/my.cnf:/etc/mysql/conf.d/my.cnf
236
+
237
+ - ./docker/db/sql:/docker-entrypoint-initdb.d
238
+
239
+ ports:
240
+
241
+ - 3306:3306
242
+
243
+
244
+
245
+ phpmyadmin:
246
+
247
+ image: phpmyadmin/phpmyadmin
248
+
249
+ container_name: phpmyadmin
250
+
251
+ environment:
252
+
253
+ - PMA_ARBITRARY=1
254
+
255
+ - PMA_HOST=db-host
256
+
257
+ - PMA_USER=docker
258
+
259
+ - PMA_PASSWORD=docker
260
+
261
+ links:
262
+
263
+ - db
264
+
265
+ ports:
266
+
267
+ - 8080:80
268
+
269
+ volumes:
270
+
271
+ - /sessions
272
+
273
+
274
+
275
+ ```
276
+
277
+ ちなみに下記のサイトを参考にしました。
278
+
279
+ https://qiita.com/3no3_tw/items/25cb7c0c09d51b56eb5a