Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to uvicorn to launch the daemon; optionally, run it in a container #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.9.5-alpine3.13
WORKDIR /code
ENV FASTAPI_APP=app.py
ENV FASTAPI_RUN_HOST=0.0.0.0
RUN apk add --no-cache gcc musl-dev linux-headers make
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
EXPOSE 5000
COPY . .
CMD ["python", "wsgi.py"]
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ Type "Y" to accept the message (which is just there to prevent you accidentally
Finally run the app with

```
python wsgi.py
uvicorn wsgi.py
```

Navigate to the posted URL in your terminal to be greeted with Swagger, where you can test out the API.
Navigate to http://127.0.0.1:8000/docs to be greeted with Swagger,
where you can test out the API.



Expand All @@ -52,3 +53,9 @@ pip install pytest
pytest
```

## Running via docker-compose
```
docker-compose up

```

6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "3.9"
services:
web:
build: .
ports:
- "5000:5000"
20 changes: 20 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
aiofiles==0.7.0
aniso8601==7.0.0
appdirs==1.4.4
astroid==2.4.2
async-exit-stack==1.0.1
async-generator==1.10
attrs==19.3.0
black==19.10b0
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
dnspython==2.1.0
email-validator==1.1.2
fastapi==0.58.1
Flask==1.1.2
Flask-SQLAlchemy==2.5.1
graphene==2.1.8
graphql-core==2.3.2
graphql-relay==2.0.1
h11==0.9.0
httptools==0.1.1
idna==2.10
Expand All @@ -21,24 +31,34 @@ mccabe==0.6.1
more-itertools==8.4.0
mypy==0.782
mypy-extensions==0.4.3
numpy==1.20.3
orjson==3.5.2
packaging==20.4
pandas==1.2.4
pathspec==0.8.0
pluggy==0.13.1
promise==2.3
py==1.9.0
pydantic==1.5.1
pyhumps==1.3.1
pylint==2.5.3
pyparsing==2.4.7
pytest==5.4.3
pytest-asyncio==0.14.0
python-dateutil==2.8.1
python-multipart==0.0.5
pytz==2021.1
PyYAML==5.4.1
regex==2020.6.8
requests==2.24.0
Rx==1.6.1
six==1.15.0
SQLAlchemy==1.3.18
starlette==0.13.4
toml==0.10.1
typed-ast==1.4.1
typing-extensions==3.7.4.2
ujson==4.0.2
urllib3==1.25.9
uvicorn==0.11.5
uvloop==0.14.0
Expand Down