質問編集履歴
7
削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
-
Dockerfile
|
43
|
+
Dockerfile内容
|
44
44
|
|
45
45
|
--
|
46
46
|
|
6
ファイル追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,6 +23,8 @@
|
|
23
23
|
wed
|
24
24
|
|
25
25
|
|_Dockerfile
|
26
|
+
|
27
|
+
|_uwsgi.ini
|
26
28
|
|
27
29
|
|_nginx
|
28
30
|
|
5
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
# base image
|
48
48
|
|
49
|
-
FROM python
|
49
|
+
FROM python
|
50
50
|
|
51
51
|
|
52
52
|
|
@@ -62,45 +62,19 @@
|
|
62
62
|
|
63
63
|
|
64
64
|
|
65
|
-
#
|
65
|
+
# pip install
|
66
66
|
|
67
|
-
RUN apt-get upgrade -y
|
68
|
-
|
69
|
-
RUN
|
67
|
+
RUN pip install pipenv
|
70
|
-
|
71
|
-
python3-dev \
|
72
|
-
|
73
|
-
libsqlite3-dev \
|
74
|
-
|
75
|
-
libreadline6-dev \
|
76
|
-
|
77
|
-
libgdbm-dev \
|
78
|
-
|
79
|
-
libbz2-dev \
|
80
|
-
|
81
|
-
tk-dev
|
82
68
|
|
83
69
|
|
84
70
|
|
85
|
-
# pip install
|
86
|
-
|
87
|
-
RUN pip install virtualenv \
|
88
|
-
|
89
|
-
ipython \
|
90
|
-
|
91
|
-
flask Flask-SQLAlchemy \
|
92
|
-
|
93
|
-
Flask
|
94
|
-
|
95
|
-
RUN pip install
|
71
|
+
RUN pipenv install uwsgi
|
96
|
-
|
97
|
-
RUN pip install --upgrade setuptools
|
98
72
|
|
99
73
|
|
100
74
|
|
101
|
-
|
75
|
+
CMD ["pipenv", "run", "uwsgi", "uwsgi.ini"]
|
102
76
|
|
103
|
-
|
77
|
+
|
104
78
|
|
105
79
|
```
|
106
80
|
|
@@ -114,19 +88,7 @@
|
|
114
88
|
|
115
89
|
コンテナ起動
|
116
90
|
|
117
|
-
`docker run -p 5000:5000 -it sample`
|
91
|
+
`docker run -p 5000:5000 -it sample`
|
118
|
-
|
119
|
-
```
|
120
|
-
|
121
|
-
Python 3.7.4 (default, Sep 12 2019, 15:40:15)
|
122
|
-
|
123
|
-
[GCC 8.3.0] on linux
|
124
|
-
|
125
|
-
Type "help", "copyright", "credits" or "license" for more information.
|
126
|
-
|
127
|
-
>>>
|
128
|
-
|
129
|
-
```
|
130
92
|
|
131
93
|
エラー確認
|
132
94
|
|
4
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,9 +24,15 @@
|
|
24
24
|
|
25
25
|
|_Dockerfile
|
26
26
|
|
27
|
+
|_nginx
|
28
|
+
|
27
|
-
|_
|
29
|
+
| |_ Dokerfile
|
30
|
+
|
31
|
+
| |_ nginx.conf
|
28
32
|
|
29
33
|
|_app.py
|
34
|
+
|
35
|
+
|
30
36
|
|
31
37
|
|
32
38
|
|
3
不要箇所削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,46 +98,6 @@
|
|
98
98
|
|
99
99
|
```
|
100
100
|
|
101
|
-
```yml
|
102
|
-
|
103
|
-
version: '3'
|
104
|
-
|
105
|
-
services:
|
106
|
-
|
107
|
-
python3:
|
108
|
-
|
109
|
-
restart: always
|
110
|
-
|
111
|
-
build: .
|
112
|
-
|
113
|
-
tty: true
|
114
|
-
|
115
|
-
volumes:
|
116
|
-
|
117
|
-
- ./:/root/
|
118
|
-
|
119
|
-
application:
|
120
|
-
|
121
|
-
container_name: python-flask-app
|
122
|
-
|
123
|
-
build: .
|
124
|
-
|
125
|
-
ports:
|
126
|
-
|
127
|
-
- "5000:5000"
|
128
|
-
|
129
|
-
tty: true
|
130
|
-
|
131
|
-
environment:
|
132
|
-
|
133
|
-
TZ: Asia/Tokyo
|
134
|
-
|
135
|
-
command: flask run --host 0.0.0.0 --port 5000
|
136
|
-
|
137
|
-
```
|
138
|
-
|
139
|
-
|
140
|
-
|
141
101
|
使用コマンド
|
142
102
|
|
143
103
|
--
|
2
誤記削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -144,7 +144,7 @@
|
|
144
144
|
|
145
145
|
イメージ作成
|
146
146
|
|
147
|
-
`docker image build -t sample
|
147
|
+
`docker image build -t sample .`
|
148
148
|
|
149
149
|
コンテナ起動
|
150
150
|
|
1
誤記削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -148,10 +148,6 @@
|
|
148
148
|
|
149
149
|
コンテナ起動
|
150
150
|
|
151
|
-
`docker container run -d -p 5000:5000 sample:latest`
|
152
|
-
|
153
|
-
|
154
|
-
|
155
151
|
`docker run -p 5000:5000 -it sample`を使用した後は、コンテナ内に入っているようです。
|
156
152
|
|
157
153
|
```
|