Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit adb1033

Browse files
authored
Merge pull request #5 from testdrivenio/updates
update dependencies
2 parents f5b128b + 5f62261 commit adb1033

File tree

7 files changed

+30
-17
lines changed

7 files changed

+30
-17
lines changed

‎LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Michael Herman
3+
Copyright (c) 2021 Michael Herman
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

‎docker-compose.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
version: '3.7'
1+
version: '3.8'
22

33
services:
44
web:
55
build: ./src
6-
command: uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000
6+
command: |
7+
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000'
78
volumes:
89
- ./src/:/usr/src/app/
910
ports:
1011
- 8002:8000
1112
environment:
1213
- DATABASE_URL=postgresql://hello_fastapi:hello_fastapi@db/hello_fastapi_dev
1314
db:
14-
image: postgres:12.1-alpine
15+
image: postgres:13-alpine
1516
volumes:
1617
- postgres_data:/var/lib/postgresql/data/
18+
expose:
19+
- 5432
1720
environment:
1821
- POSTGRES_USER=hello_fastapi
1922
- POSTGRES_PASSWORD=hello_fastapi

‎src/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pull official base image
2-
FROM python:3.8.1-alpine
2+
FROM python:3.9.4-alpine
33

44
# set work directory
55
WORKDIR /usr/src/app
@@ -15,7 +15,7 @@ COPY ./requirements.txt /usr/src/app/requirements.txt
1515
RUN set -eux \
1616
&& apk add --no-cache --virtual .build-deps build-base \
1717
libressl-dev libffi-dev gcc musl-dev python3-dev \
18-
postgresql-dev \
18+
postgresql-dev bash \
1919
&& pip install --upgrade pip setuptools wheel \
2020
&& pip install -r /usr/src/app/requirements.txt \
2121
&& rm -rf /root/.cache/pip

‎src/app/api/notes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from typing import List
22

3+
from fastapi import APIRouter, HTTPException, Path
4+
35
from app.api import crud
46
from app.api.models import NoteDB, NoteSchema
5-
from fastapi import APIRouter, HTTPException, Path
67

78
router = APIRouter()
89

‎src/app/db.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import os
22

3-
from sqlalchemy import (Column, DateTime, Integer, MetaData, String, Table,
4-
create_engine)
3+
from sqlalchemy import (
4+
Column,
5+
DateTime,
6+
Integer,
7+
MetaData,
8+
String,
9+
Table,
10+
create_engine
11+
)
512
from sqlalchemy.sql import func
613

714
from databases import Database

‎src/app/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from fastapi import FastAPI
2+
13
from app.api import notes, ping
24
from app.db import database, engine, metadata
3-
from fastapi import FastAPI
45

56
metadata.create_all(engine)
67

‎src/requirements.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
asyncpg==0.20.0
2-
databases[postgresql]==0.2.6
3-
fastapi==0.46.0
4-
SQLAlchemy==1.3.12
5-
uvicorn==0.11.1
1+
asyncpg==0.22.0
2+
databases[postgresql]==0.4.3
3+
fastapi==0.63.0
4+
psycopg2-binary==2.8.6
5+
SQLAlchemy==1.3.24
6+
uvicorn==0.13.4
67

78
# dev
8-
pytest==5.3.2
9-
requests==2.22.0
9+
pytest==6.2.3
10+
requests==2.25.1

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /