From d4d7d2d1717fb71a451defec7097561c3f90a5fb Mon Sep 17 00:00:00 2001 From: GabrielDS Date: Wed, 1 Apr 2020 21:33:41 -0300 Subject: [PATCH] Add Docker files --- .dockerignore | 5 +++++ Dockerfile | 18 ++++++++++++++++++ docker-compose.yml | 14 ++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..02346aa4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.gitignore +README.md +.github +.travis.yml +.env.example \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5af5e337 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7 + +# ENVS RECOMENDATIONS +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# PREPARE FOLDER +WORKDIR /api + +# COPY DEPENDENCIES +COPY Pipfile Pipfile.lock ./ + +# INSTALL DEPENDENCIES +RUN pip install pipenv +RUN pipenv install --system --deploy --dev + +# COPY PROJECT +COPY . / diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..d78e92ac --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' + +services: + api: + build: . + image: expdev07/coronavirus-tracker-api:2.0 + restart: always + command: uvicorn --host 0.0.0.0 app.main:APP + volumes: + - .:/api + ports: + - "8000:8000" + stdin_open: true + tty: true