Skip to content

nginx を再度導入した#85

Open
shun-harutaro wants to merge 1 commit into
mainfrom
fix/#3_nginx
Open

nginx を再度導入した#85
shun-harutaro wants to merge 1 commit into
mainfrom
fix/#3_nginx

Conversation

@shun-harutaro

Copy link
Copy Markdown
Member

概要

関連タスク

Close #3 (required)

やったこと

やらないこと

レビュー事項

補足 参考情報

Comment thread docker-compose.yml
ports:
- "80:80"
# expose:
# - 8000

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expose: 8000とすることで、ホストマシンからはアクセスできないが、コンテナ同士ではアクセスができる

Comment thread _docker/api/Dockerfile
@@ -47,4 +47,4 @@ COPY --from=production /api /api

EXPOSE 8000

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DockerfileのEXPOSEは明示的にするもので、これにより動作が変わることはないらしい

Comment thread _docker/api/Dockerfile Outdated

EXPOSE 8000

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pythonプロジェクトのデフォルトポートである8000に変更

@@ -1,5 +1,5 @@
upstream backend {
server api;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8000番ポートが公開されていないので、502になるのは当然。 #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conf.d/app.conf でポート番号指定すると502になる

1 participant