Skip to content

Commit

Permalink
add: Dockerイメージが作成できるように
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosugamea committed Nov 11, 2020
1 parent 10968af commit 08d835a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
tester
__pycache__
README.md
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Pythonイメージの取得
FROM python:3.8.6-slim-buster
# ワーキングディレクトリの指定
WORKDIR /usr/local/app
# モジュールを揃える
COPY . .
RUN pip install -r requirements.txt
RUN pip install -r blueprints/lib/requirements.txt
# 起動環境設定
EXPOSE 5000
ENTRYPOINT [ "gunicorn", "app:app" ]
CMD [ "-c", "gunicorn_config.py" ]
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ def createApp():

if __name__ == '__main__':
app.debug = True
app.run(host="localhost")
app.run(host="0.0.0.0")
4 changes: 2 additions & 2 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import multiprocessing

workers = multiprocessing.cpu_count() * 2 + 1
bind = 'unix:flaskrest.sock'
bind = '0.0.0.0:5000'
umask = 0o007
reload = True

#logging
# logging
accesslog = '-'
errorlog = '-'

0 comments on commit 08d835a

Please sign in to comment.