Skip to content

Commit 9f398ff

Browse files
authored
Merge pull request #2 from mitty1293/develop
Develop
2 parents 3910f5b + 22a4e9d commit 9f398ff

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NGINX_PORT=8004

docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
volumes:
1010
- ./flask/app:/usr/src/app
1111
networks:
12-
- net_return_http_status_code
12+
- internal
1313
# -w 2 -> リクエストをさばくWorkerプロセスの数
1414
# -b 0.0.0.0:8000 app:app -> appを自身の8000ポートと結合する(Flaskアプリへの接続先を設定する)
1515
# DockerfileのWORKDIRで/usr/srcに移動。そのままappと同階層でgunicornを起動するため詳細なappの場所は指定不要
@@ -21,9 +21,9 @@ services:
2121
dockerfile: Dockerfile
2222
container_name: nginx_return_http_status_code
2323
ports:
24-
- "8004:80"
24+
- "${NGINX_PORT}:80"
2525
networks:
26-
- net_return_http_status_code
26+
- internal
2727
networks:
28-
net_return_http_status_code:
28+
internal:
2929
driver: bridge

flask/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM python:3.9.5-slim-buster
1+
FROM python:3.9.7-slim-bullseye
22

33
WORKDIR /usr/src
44

5-
COPY requirements.txt ./
6-
RUN pip3 install --no-cache-dir -r requirements.txt
5+
RUN pip3 install --upgrade pip && \
6+
pip3 install --no-cache-dir \
7+
Flask==2.0.1 \
8+
gunicorn==20.1.0

flask/requirements.txt

-2
This file was deleted.

0 commit comments

Comments
 (0)