https://github.com/mgckaled/rs__devops_containers_challenge
Este projeto consiste em uma API FastAPI encapsulada em um container Docker, utilizando SQLite como banco de dados e gerenciando dependências com Pipenv
https://github.com/mgckaled/rs__devops_containers_challenge
docker-compose fastapi pylint pytest python sqlite
Last synced: 2 months ago
JSON representation
Este projeto consiste em uma API FastAPI encapsulada em um container Docker, utilizando SQLite como banco de dados e gerenciando dependências com Pipenv
- Host: GitHub
- URL: https://github.com/mgckaled/rs__devops_containers_challenge
- Owner: mgckaled
- Created: 2025-04-03T16:16:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-03T17:19:21.000Z (about 1 year ago)
- Last Synced: 2025-04-09T16:47:07.302Z (about 1 year ago)
- Topics: docker-compose, fastapi, pylint, pytest, python, sqlite
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Container Challenge
Este projeto consiste em uma API FastAPI encapsulada em um container Docker, utilizando SQLite como banco de dados e gerenciando dependências com Pipenv.
---
## 🚀 Tecnologias Utilizadas
- **Python 3.11.9**
- **FastAPI**
- **SQLite**
- **Uvicorn**
- **Docker & Docker Compose**
- **Pipenv** (Gerenciamento de dependências)
- **Pytest** (Testes automatizados)
---
## 📦 Estrutura do Projeto
```plaintext
/meu_projeto
│── Pipfile
│── Pipfile.lock
│── Dockerfile
│── docker-compose.yml
│── app/
│ ├── main.py
│ ├── database.py
│ ├── models.py
│ ├── crud.py
│ ├── schemas.py
│ ├── routers/
│ │ ├── users.py
│ │ ├── __init__.py
│ ├── __init__.py
│── .env
│── README.md
│── tests/
│ ├── test_main.py
│ ├── __init__.py
│── database.db
```
---
## 🛠️ Configuração e Execução
### 1️⃣ Clonar o repositório
```sh
git clone https://github.com/seu-usuario/container_challenge.git
cd container_challenge
```
### 2️⃣ Configurar o ambiente
Instale as dependências usando Pipenv:
```sh
pipenv install
```
### 3️⃣ Rodar os testes
```sh
pipenv run pytest
```
### 4️⃣ Construir e subir os containers
```sh
docker-compose up --build
```
A API estará disponível em `http://localhost:8000`.
---
## 🧪 Testando a API
Acesse a documentação interativa do FastAPI:
```powershell
http://localhost:8000/docs
```
Ou utilize a interface alternativa:
```powersell
http://localhost:8000/redoc
```