質問編集履歴

1

書式の改善

2021/10/18 05:09

投稿

Sayre
Sayre

スコア23

test CHANGED
File without changes
test CHANGED
@@ -100,266 +100,6 @@
100
100
 
101
101
 
102
102
 
103
- docker-compose.yml(変更前)
104
-
105
- ```
106
-
107
- version: '3.7'
108
-
109
- services:
110
-
111
- server:
112
-
113
- build:
114
-
115
- context: ./backend
116
-
117
- dockerfile: Dockerfile
118
-
119
- volumes:
120
-
121
- - ./backend/:/backend/
122
-
123
- - /var/run/docker.sock:/var/run/docker.sock
124
-
125
- command: uvicorn app.api.server:app --reload --workers 1 --host 0.0.0.0 --port 8000
126
-
127
- env_file:
128
-
129
- - ./backend/.env
130
-
131
- ports:
132
-
133
- - 8000:8000
134
-
135
- depends_on:
136
-
137
- - db
138
-
139
-
140
-
141
- db:
142
-
143
- image: postgres:13.1-alpine
144
-
145
- volumes:
146
-
147
- - postgres_data:/var/lib/postgresql/data/
148
-
149
- env_file:
150
-
151
- - ./backend/.env
152
-
153
- ports:
154
-
155
- - 5432:5432
156
-
157
- ```
158
-
159
-
160
-
161
- docker-compose.yml(変更後)
162
-
163
- ```
164
-
165
- version: '3.7'
166
-
167
- services:
168
-
169
- server:
170
-
171
- build:
172
-
173
- context: ./backend
174
-
175
- dockerfile: Dockerfile
176
-
177
- volumes:
178
-
179
- - ./backend/:/backend/
180
-
181
- - /var/run/docker.sock:/var/run/docker.sock
182
-
183
- command: uvicorn app.api.server:app --reload --workers 1 --host 0.0.0.0 --port 8000
184
-
185
- env_file:
186
-
187
- - ./backend/.env
188
-
189
- ports:
190
-
191
- - 8000:8000
192
-
193
- depends_on:
194
-
195
- - db
196
-
197
-
198
-
199
- db:
200
-
201
- image: mysql:5.7
202
-
203
- command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
204
-
205
- restart: always
206
-
207
- volumes:
208
-
209
- - db_vol:/var/lib/mysql
210
-
211
- environment:
212
-
213
- MYSQL_ROOT_PASSWORD: mysql
214
-
215
- MYSQL_DATABASE: app
216
-
217
- MYSQL_USER: mysql
218
-
219
- MYSQL_PASSWORD: mysql
220
-
221
- ports:
222
-
223
- - "3306:3306"
224
-
225
-
226
-
227
- volumes:
228
-
229
- db_vol:
230
-
231
-
232
-
233
- volumes:
234
-
235
- postgres_data:
236
-
237
- ```
238
-
239
-
240
-
241
- requirement.txt(変更前)
242
-
243
- ```
244
-
245
- fastapi==0.63.0
246
-
247
- uvicorn==0.13.3
248
-
249
- databases[postgresql]==0.4.1
250
-
251
- SQLAlchemy==1.3.22
252
-
253
- alembic==1.5.2
254
-
255
- psycopg2==2.8.6
256
-
257
- ```
258
-
259
- requirement.txt(変更後)
260
-
261
- ```
262
-
263
- fastapi==0.63.0
264
-
265
- uvicorn==0.13.3
266
-
267
- databases[mysql]==0.4.1
268
-
269
- SQLAlchemy==1.3.22
270
-
271
- alembic==1.5.2
272
-
273
- PyMySQL==0.9.3
274
-
275
- ```
276
-
277
-
278
-
279
- Dokerfile(変更前)
280
-
281
- ```
282
-
283
- FROM python:3.9-alpine
284
-
285
-
286
-
287
- WORKDIR /backend
288
-
289
-
290
-
291
- ENV PYTHONDONTWRITEBYTECODE 1
292
-
293
- ENV PYTHONBUFFERED 1
294
-
295
-
296
-
297
- COPY ./requirements.txt /backend/requirements.txt
298
-
299
-
300
-
301
- RUN set -eux \
302
-
303
- && apk add --no-cache build-base \
304
-
305
- && pip install --upgrade pip setuptools wheel \
306
-
307
- && pip install --no-cache-dir --trusted-host pypi.python.org -r /backend/requirements.txt \
308
-
309
- && apk del build-base \
310
-
311
- && rm -rf /root/.cache/pip
312
-
313
-
314
-
315
- COPY . /backend
316
-
317
- ```
318
-
319
-
320
-
321
- Dokcerfile(変更後)
322
-
323
- ```
324
-
325
- FROM python:3.9-alpine
326
-
327
-
328
-
329
- WORKDIR /backend
330
-
331
-
332
-
333
- ENV PYTHONDONTWRITEBYTECODE 1
334
-
335
- ENV PYTHONBUFFERED 1
336
-
337
-
338
-
339
- COPY ./requirements.txt /backend/requirements.txt
340
-
341
-
342
-
343
- RUN set -eux \
344
-
345
- && apk add --no-cache build-base mariadb-dev \
346
-
347
- && pip install --upgrade pip setuptools wheel \
348
-
349
- && pip install --no-cache-dir --trusted-host pypi.python.org -r /backend/requirements.txt \
350
-
351
- && apk del build-base \
352
-
353
- && rm -rf /root/.cache/pip
354
-
355
-
356
-
357
- COPY . /backend
358
-
359
- ```
360
-
361
-
362
-
363
103
  config.py(変更前)
364
104
 
365
105
  ```