Skip to content

Commit 6eb92df

Browse files
authored
Uvicorn based Docker (#282)
* single uvicorn based api * update readme
1 parent 2255dc9 commit 6eb92df

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ invoke docker --build
472472

473473
Run with `docker run` or `docker-compose`
474474

475+
#### Alternate Docker images
476+
477+
If a full `gunicorn` deployment is unnecessary or [impractical on your hardware](https://fastapi.tiangolo.com/deployment/#raspberry-pi-and-other-architectures) consider using our single instance [`Uvicorn`](https://www.uvicorn.org/) based [Dockerfile](uvicorn.Dockerfile).
478+
479+
475480
### Invoke
476481

477482
Additional developer commands can be run by calling them with the [python `invoke` task runner](http://www.pyinvoke.org/).

uvicorn.Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3.7
2+
3+
# COPY DEPENDENCIES
4+
COPY requirements.txt ./
5+
6+
# COPY PROJECT
7+
COPY ./app /app
8+
9+
EXPOSE 80
10+
11+
# INSTALL DEPENDENCIES
12+
RUN pip install --no-cache-dir -r requirements.txt
13+
14+
CMD ["uvicorn", "app.main:APP", "--host", "0.0.0.0", "--port", "80"]

0 commit comments

Comments
 (0)