From 04542cd0eecb2d6ec3eaecc614c9b0eac2afb1e3 Mon Sep 17 00:00:00 2001 From: senshiacy Date: Thu, 4 Dec 2025 14:42:58 -0300 Subject: [PATCH] Adicionado o dockerfile --- .dockerignore | 2 ++ Dockerfile | 10 ++++++++++ README.md | 30 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..210c47a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d23fc19 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.12-alpine +WORKDIR /code +ENV FAST_APP=src/ +ENV FAST_RUN_HOST=0.0.0.0 +RUN apk add --no-cache gcc musl-dev linux-headers +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt +EXPOSE 8000 +COPY . . +CMD ["python3.12", "-m", "src.main"] \ No newline at end of file diff --git a/README.md b/README.md index 5422e84..4bd289b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,36 @@ Este projeto implementa um sistema gamificado onde usuários ganham pontos ao us - Python 3.11+ - pip +### Instalação e Execução com docker +1. **Clone o repositório**: + ```bash + cd /home/kim/code/estudos/bussp + ``` + +2. **Execute**: + ```bash + docker run -d -p 127.0.0.1:8000:8000 backend + ``` + +3. **Acesse a API**: + - API: http://localhost:8000 + - Documentação interativa: http://localhost:8000/docs + - Documentação alternativa: http://localhost:8000/redoc + +4. **Para matar o container**: + Pegue o id do container em `CONTAINER ID` + ```bash + docker ps + ``` + ```bash + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + ``` + Execute: + ```bash + docker stop ${id} + docker rm ${id} + ``` + ### Instalação e Execução 1. **Clone o repositório**: