Skip to content

Commit 5b01979

Browse files
authored
Add Docker files (#252)
1 parent c39abee commit 5b01979

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 requirements.txt ./
12+
13+
# INSTALL DEPENDENCIES
14+
RUN pip install -r requirements.txt
15+
16+
# COPY PROJECT
17+
COPY . /

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: uvicorn --host 0.0.0.0 app.main:APP
9+
volumes:
10+
- .:/api
11+
ports:
12+
- "8000:8000"
13+
stdin_open: true
14+
tty: true

0 commit comments

Comments
 (0)