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..083e2f90 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7 + +# ENVS RECOMENDATIONS +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# PREPARE FOLDER +WORKDIR /api + +# COPY DEPENDENCIES +COPY requirements.txt ./ + +# INSTALL DEPENDENCIES +RUN pip install -r requirements.txt + +# 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