質問編集履歴

2

追加情報

2021/07/18 01:34

投稿

kensho-
kensho-

スコア6

test CHANGED
File without changes
test CHANGED
@@ -89,3 +89,469 @@
89
89
  **試したこと**
90
90
 
91
91
  色々調べてたら、fargate内のタスク内でのコンテナ同士のやり取りは、ネットワークにlocalhostを指定することでやりとりできるという記事をみたので、nginx.confのupstream configの中のdjangoの部分をlocalhostに変更して再度試したのですが、起動できませんでした。。。(しかし、nginxのログは消えました)
92
+
93
+
94
+
95
+
96
+
97
+ 追記:
98
+
99
+ タスク定義の内容
100
+
101
+ ```json
102
+
103
+ {
104
+
105
+ "ipcMode": null,
106
+
107
+ "executionRoleArn": "arn:aws:iam::**************:role/ecsTaskExecutionRole",
108
+
109
+ "containerDefinitions": [
110
+
111
+ {
112
+
113
+ "dnsSearchDomains": null,
114
+
115
+ "environmentFiles": null,
116
+
117
+ "logConfiguration": {
118
+
119
+ "logDriver": "awslogs",
120
+
121
+ "secretOptions": null,
122
+
123
+ "options": {
124
+
125
+ "awslogs-group": "/ecs/******************************",
126
+
127
+ "awslogs-region": "ap-northeast-1",
128
+
129
+ "awslogs-stream-prefix": "ecs"
130
+
131
+ }
132
+
133
+ },
134
+
135
+ "entryPoint": null,
136
+
137
+ "portMappings": [
138
+
139
+ {
140
+
141
+ "hostPort": 8000,
142
+
143
+ "protocol": "tcp",
144
+
145
+ "containerPort": 8000
146
+
147
+ }
148
+
149
+ ],
150
+
151
+ "command": [
152
+
153
+ "python3",
154
+
155
+ "manage.py",
156
+
157
+ "runserver",
158
+
159
+ "0.0.0.0:8000"
160
+
161
+ ],
162
+
163
+ "linuxParameters": null,
164
+
165
+ "cpu": 0,
166
+
167
+ "environment": [],
168
+
169
+ "resourceRequirements": null,
170
+
171
+ "ulimits": null,
172
+
173
+ "dnsServers": null,
174
+
175
+ "mountPoints": [],
176
+
177
+ "workingDirectory": "/usr/src/app/",
178
+
179
+ "secrets": null,
180
+
181
+ "dockerSecurityOptions": null,
182
+
183
+ "memory": null,
184
+
185
+ "memoryReservation": 128,
186
+
187
+ "volumesFrom": [],
188
+
189
+ "stopTimeout": null,
190
+
191
+ "image": "djangoイメージ",
192
+
193
+ "startTimeout": null,
194
+
195
+ "firelensConfiguration": null,
196
+
197
+ "dependsOn": null,
198
+
199
+ "disableNetworking": null,
200
+
201
+ "interactive": null,
202
+
203
+ "healthCheck": {
204
+
205
+ "retries": 10,
206
+
207
+ "command": [
208
+
209
+ "CMD-SHELL",
210
+
211
+ "curl -f http://localhost:8000/"
212
+
213
+ ],
214
+
215
+ "timeout": 60,
216
+
217
+ "interval": 5,
218
+
219
+ "startPeriod": 120
220
+
221
+ },
222
+
223
+ "essential": true,
224
+
225
+ "links": null,
226
+
227
+ "hostname": null,
228
+
229
+ "extraHosts": null,
230
+
231
+ "pseudoTerminal": null,
232
+
233
+ "user": null,
234
+
235
+ "readonlyRootFilesystem": null,
236
+
237
+ "dockerLabels": null,
238
+
239
+ "systemControls": null,
240
+
241
+ "privileged": null,
242
+
243
+ "name": "django"
244
+
245
+ },
246
+
247
+ {
248
+
249
+ "dnsSearchDomains": null,
250
+
251
+ "environmentFiles": null,
252
+
253
+ "logConfiguration": {
254
+
255
+ "logDriver": "awslogs",
256
+
257
+ "secretOptions": null,
258
+
259
+ "options": {
260
+
261
+ "awslogs-group": "/ecs/******************************",
262
+
263
+ "awslogs-region": "ap-northeast-1",
264
+
265
+ "awslogs-stream-prefix": "ecs"
266
+
267
+ }
268
+
269
+ },
270
+
271
+ "entryPoint": [],
272
+
273
+ "portMappings": [
274
+
275
+ {
276
+
277
+ "hostPort": 80,
278
+
279
+ "protocol": "tcp",
280
+
281
+ "containerPort": 80
282
+
283
+ }
284
+
285
+ ],
286
+
287
+ "command": [],
288
+
289
+ "linuxParameters": null,
290
+
291
+ "cpu": 0,
292
+
293
+ "environment": [],
294
+
295
+ "resourceRequirements": null,
296
+
297
+ "ulimits": null,
298
+
299
+ "dnsServers": null,
300
+
301
+ "mountPoints": [],
302
+
303
+ "workingDirectory": null,
304
+
305
+ "secrets": null,
306
+
307
+ "dockerSecurityOptions": null,
308
+
309
+ "memory": null,
310
+
311
+ "memoryReservation": 128,
312
+
313
+ "volumesFrom": [],
314
+
315
+ "stopTimeout": null,
316
+
317
+ "image": "nginxイメージ",
318
+
319
+ "startTimeout": null,
320
+
321
+ "firelensConfiguration": null,
322
+
323
+ "dependsOn": [
324
+
325
+ {
326
+
327
+ "containerName": "django",
328
+
329
+ "condition": "HEALTHY"
330
+
331
+ }
332
+
333
+ ],
334
+
335
+ "disableNetworking": null,
336
+
337
+ "interactive": null,
338
+
339
+ "healthCheck": null,
340
+
341
+ "essential": true,
342
+
343
+ "links": [],
344
+
345
+ "hostname": null,
346
+
347
+ "extraHosts": null,
348
+
349
+ "pseudoTerminal": null,
350
+
351
+ "user": null,
352
+
353
+ "readonlyRootFilesystem": null,
354
+
355
+ "dockerLabels": null,
356
+
357
+ "systemControls": null,
358
+
359
+ "privileged": null,
360
+
361
+ "name": "nginx"
362
+
363
+ }
364
+
365
+ ],
366
+
367
+ "placementConstraints": [],
368
+
369
+ "memory": "512",
370
+
371
+ "taskRoleArn": null,
372
+
373
+ "compatibilities": [
374
+
375
+ "EC2",
376
+
377
+ "FARGATE"
378
+
379
+ ],
380
+
381
+ "taskDefinitionArn": "arn:aws:ecs:******************************",
382
+
383
+ "family": "******************************,
384
+
385
+ "requiresAttributes": [
386
+
387
+ {
388
+
389
+ "targetId": null,
390
+
391
+ "targetType": null,
392
+
393
+ "value": null,
394
+
395
+ "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
396
+
397
+ },
398
+
399
+ {
400
+
401
+ "targetId": null,
402
+
403
+ "targetType": null,
404
+
405
+ "value": null,
406
+
407
+ "name": "ecs.capability.execution-role-awslogs"
408
+
409
+ },
410
+
411
+ {
412
+
413
+ "targetId": null,
414
+
415
+ "targetType": null,
416
+
417
+ "value": null,
418
+
419
+ "name": "com.amazonaws.ecs.capability.ecr-auth"
420
+
421
+ },
422
+
423
+ {
424
+
425
+ "targetId": null,
426
+
427
+ "targetType": null,
428
+
429
+ "value": null,
430
+
431
+ "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
432
+
433
+ },
434
+
435
+ {
436
+
437
+ "targetId": null,
438
+
439
+ "targetType": null,
440
+
441
+ "value": null,
442
+
443
+ "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
444
+
445
+ },
446
+
447
+ {
448
+
449
+ "targetId": null,
450
+
451
+ "targetType": null,
452
+
453
+ "value": null,
454
+
455
+ "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
456
+
457
+ },
458
+
459
+ {
460
+
461
+ "targetId": null,
462
+
463
+ "targetType": null,
464
+
465
+ "value": null,
466
+
467
+ "name": "ecs.capability.container-health-check"
468
+
469
+ },
470
+
471
+ {
472
+
473
+ "targetId": null,
474
+
475
+ "targetType": null,
476
+
477
+ "value": null,
478
+
479
+ "name": "ecs.capability.container-ordering"
480
+
481
+ },
482
+
483
+ {
484
+
485
+ "targetId": null,
486
+
487
+ "targetType": null,
488
+
489
+ "value": null,
490
+
491
+ "name": "ecs.capability.execution-role-ecr-pull"
492
+
493
+ },
494
+
495
+ {
496
+
497
+ "targetId": null,
498
+
499
+ "targetType": null,
500
+
501
+ "value": null,
502
+
503
+ "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
504
+
505
+ },
506
+
507
+ {
508
+
509
+ "targetId": null,
510
+
511
+ "targetType": null,
512
+
513
+ "value": null,
514
+
515
+ "name": "ecs.capability.task-eni"
516
+
517
+ },
518
+
519
+ {
520
+
521
+ "targetId": null,
522
+
523
+ "targetType": null,
524
+
525
+ "value": null,
526
+
527
+ "name": "******************************"
528
+
529
+ }
530
+
531
+ ],
532
+
533
+ "pidMode": null,
534
+
535
+ "requiresCompatibilities": [
536
+
537
+ "FARGATE"
538
+
539
+ ],
540
+
541
+ "networkMode": "awsvpc",
542
+
543
+ "cpu": "256",
544
+
545
+ "revision": 8,
546
+
547
+ "status": "ACTIVE",
548
+
549
+ "inferenceAccelerators": null,
550
+
551
+ "proxyConfiguration": null,
552
+
553
+ "volumes": []
554
+
555
+ }
556
+
557
+ ```

1

誤字の修正

2021/07/18 01:34

投稿

kensho-
kensho-

スコア6

test CHANGED
File without changes
test CHANGED
@@ -88,4 +88,4 @@
88
88
 
89
89
  **試したこと**
90
90
 
91
- 色々調べてたら、fargate内のタスク内でのコンテナのやり取りは、ネットワークにlocalhostを指定することでやりとりできるという記事をみたので、nginx.confのupstream configの中のdjangoの部分をlocalhostに変更して再度試したのですが、起動できませんでした。。。(しかし、nginxのログは消えました)
91
+ 色々調べてたら、fargate内のタスク内でのコンテナ同のやり取りは、ネットワークにlocalhostを指定することでやりとりできるという記事をみたので、nginx.confのupstream configの中のdjangoの部分をlocalhostに変更して再度試したのですが、起動できませんでした。。。(しかし、nginxのログは消えました)