質問編集履歴

2

エラーコードの追記

2018/04/06 09:09

投稿

chikuwanabe
chikuwanabe

スコア12

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  vpsサーバ(centos7)にdocker-composeを使ってnginx(1.13.10),mysql(5.7)の環境を作りlaravelを動かしているのですが、
2
2
 
3
- プロジェクトを増やさなければならなくなり、新しいプロジェクトファイル設置後にnginxの設定ファイルを色々変更してみてはいるのですが、上手く表示する事が出来ません。
3
+ プロジェクトを増やさなければならなくなり、新しいプロジェクトファイル設置後にnginxの設定ファイルを色々変更してみてはいるのですが「ERR_CONNECTION_REFUSED」になり、上手く表示する事が出来ません。
4
4
 
5
5
  ※既存のプロジェクトファイルは問題なく動いています。
6
6
 

1

docker-compose及びdockerファイルを追記しました。

2018/04/06 09:08

投稿

chikuwanabe
chikuwanabe

スコア12

test CHANGED
File without changes
test CHANGED
@@ -149,3 +149,115 @@
149
149
  }
150
150
 
151
151
  ```
152
+
153
+
154
+
155
+ docker-compose.yml
156
+
157
+ ```
158
+
159
+ nginx:
160
+
161
+ build:
162
+
163
+ context: ./nginx
164
+
165
+ args:
166
+
167
+ - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
168
+
169
+ - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
170
+
171
+ volumes_from:
172
+
173
+ - applications
174
+
175
+ volumes:
176
+
177
+ - ${NGINX_HOST_LOG_PATH}:/var/log/nginx
178
+
179
+ - ${NGINX_SITES_PATH}:/etc/nginx/sites-available
180
+
181
+ ports:
182
+
183
+ - "${NGINX_HOST_HTTP_PORT}:80"
184
+
185
+ - "${NGINX_HOST_HTTPS_PORT}:443"
186
+
187
+ depends_on:
188
+
189
+ - php-fpm
190
+
191
+ networks:
192
+
193
+ - frontend
194
+
195
+ - backend
196
+
197
+ ```
198
+
199
+ Dockerfile
200
+
201
+ ```
202
+
203
+ FROM nginx:alpine
204
+
205
+
206
+
207
+ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
208
+
209
+
210
+
211
+ ADD nginx.conf /etc/nginx/
212
+
213
+
214
+
215
+ # If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
216
+
217
+
218
+
219
+ ARG CHANGE_SOURCE=false
220
+
221
+ RUN if [ ${CHANGE_SOURCE} = true ]; then \
222
+
223
+ # Change application source from dl-cdn.alpinelinux.org to aliyun source
224
+
225
+ sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \
226
+
227
+ ;fi
228
+
229
+
230
+
231
+ RUN apk update \
232
+
233
+ && apk upgrade \
234
+
235
+ && apk add --no-cache bash \
236
+
237
+ && adduser -D -H -u 1000 -s /bin/bash www-data
238
+
239
+
240
+
241
+ ARG PHP_UPSTREAM_CONTAINER=php-fpm
242
+
243
+ ARG PHP_UPSTREAM_PORT=9000
244
+
245
+
246
+
247
+ # Set upstream conf and remove the default conf
248
+
249
+ RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
250
+
251
+ && rm /etc/nginx/conf.d/default.conf
252
+
253
+
254
+
255
+ CMD ["nginx"]
256
+
257
+
258
+
259
+ EXPOSE 80 443
260
+
261
+
262
+
263
+ ```