Skip to content

Commit b7be144

Browse files
committed
Add Docker files
1 parent 2080bf8 commit b7be144

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.gitignore
2+
README.md
3+
.github
4+
.travis.yml
5+
.env.example

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
2+
3+
# ENVS RECOMENDATIONS
4+
ENV PYTHONDONTWRITEBYTECODE 1
5+
ENV PYTHONUNBUFFERED 1
6+
7+
# PREPARE FOLDER
8+
WORKDIR /api
9+
10+
# COPY DEPENDENCIES
11+
COPY Pipfile Pipfile.lock ./
12+
13+
# INSTALL DEPENDENCIES
14+
RUN pip install pipenv
15+
RUN pipenv install --system --deploy --dev
16+
17+
# COPY PROJECT
18+
COPY . /

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ uvicorn = "*"
2626
python_version = "3.8"
2727

2828
[scripts]
29-
dev = "uvicorn app.main:APP --reload"
29+
dev = "uvicorn --host 0.0.0.0 app.main:APP --reload"
3030
start = "uvicorn app.main:APP"
3131
fmt = "invoke fmt"
3232
sort = "invoke sort"

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.7'
2+
3+
services:
4+
api:
5+
build: .
6+
image: expdev07/coronavirus-tracker-api:2.0
7+
restart: always
8+
command: pipenv --python 3.7 run dev
9+
volumes:
10+
- .:/api
11+
ports:
12+
- "8000:8000"
13+
stdin_open: true
14+
tty: true

0 commit comments

Comments
 (0)