Skip to content

Commit

Permalink
INT-448: Added Dockerfile and docker-compose.yml files (#34)
Browse files Browse the repository at this point in the history
* feat: added Dockerfile and docker-compose.yml files

added Dockerfile and docker-compose.yml in order to spin an instance up
and execute the the test using the library built

* docs: added docker instructions to README.md files

Co-authored-by: Santiago Botero Ruiz <[email protected]>
  • Loading branch information
YokySantiago and Santiago Botero Ruiz authored Jan 12, 2022
1 parent 107e5f8 commit c17be89
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

WORKDIR /usr/src/app
RUN pip install onfleet

# the default command test the onfleet library
CMD [ "python", "test/test_onfleet.py" ]

# Run the image by running: docker-compose up --build
# Watch the test results by docker-compose logs
5 changes: 5 additions & 0 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ En caso de preguntas, pueden contactarnos a través de un issue [aquí](https://
* [Sinopsis](#sinopsis)
* [Instalación](#instalación)
* [Uso](#uso)
- [Pruebas unitarias](#pruebas-unitarias)
- [Límites](#límites)
- [Respuestas](#respuestas)
- [Operaciones CRUD soportadas](#operaciones-crud-soportadas)
Expand Down Expand Up @@ -69,6 +70,10 @@ onfleet_api = Onfleet(api_key="<your_api_key>") # Without the .auth.json file

Una vez que el objeto `Onfleet` object es creado, obtendremos acceso a todos los recursos de la API referenciados en la [documentación de la API de Onfleet](https://docs.onfleet.com/).

### Pruebas unitarias usando Docker

`docker-compose up --build`

### Límites
La API impone un límite de 20 peticiones por segundo entre todas las peticiones de todas las llaves de la organización. Más detalles [aquí](https://docs.onfleet.com/reference#throttling).

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ If you have any questions, please reach us by submitting an issue [here](https:/
* [Synopsis](#synopsis)
* [Installation](#installation)
* [Usage](#usage)
- [Unit testing using Docker](#unit-testing-using-docker)
- [Throttling](#throttling)
- [Responses](#responses)
- [Supported CRUD operations](#supported-crud-operations)
Expand Down Expand Up @@ -68,6 +69,10 @@ onfleet_api = Onfleet(api_key="<your_api_key>") # Without the .auth.json file

Once the `Onfleet` object is created, you will get access to all the API endpoints as documented in the [Onfleet API documentation](https://docs.onfleet.com/).

### Unit testing using Docker

`docker-compose up --build`

### Throttling
Rate limiting is enforced by the API with a threshold of 20 requests per second across all your organization's API keys. Learn more about it [here](https://docs.onfleet.com/reference#throttling).

Expand Down
5 changes: 5 additions & 0 deletions README.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* [概要](#概要)
* [安裝](#安裝)
* [使用守則](#使用守則)
- [使用Docker進行單元測試](#使用Docker進行單元測試)
- [API速限](#API速限)
- [請求回應](#請求回應)
- [支援的CRUD操作](#支援的CRUD操作)
Expand Down Expand Up @@ -65,6 +66,10 @@ onfleet_api = Onfleet() # Using the .auth.json file
onfleet_api = Onfleet(api_key="<your_api_key>") # Without the .auth.json file
```

### 使用Docker進行單元測試

`docker-compose up --build`

### API速限
原則上API的速限為每秒鐘20次請求,詳情請參考[官方文件](https://docs.onfleet.com/reference#throttling)

Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "3.7"
services:
python-onfleet:
build: .
container_name: python-onfleet

0 comments on commit c17be89

Please sign in to comment.