refactor: split Dockerfile into Dockerfile.api + Dockerfile.web for Swarm

- Remove multi-stage Dockerfile (não compatível com Swarm)
- Dockerfile.api: imagem standalone para API FastAPI
- Dockerfile.web: imagem standalone para Streamlit
- docker-compose.yml: aponta para os Dockerfiles separados
- README.md: instruções de build individual + deploy Swarm
This commit is contained in:
CM Consultor
2026-08-09 02:57:51 +00:00
parent 91f49c9367
commit c711d99fbc
5 changed files with 78 additions and 53 deletions

21
Dockerfile.web Normal file
View File

@@ -0,0 +1,21 @@
# Imagem única para Streamlit — pronta para Docker Swarm.
# Build: docker build -t pdf-toolkit-web:1.0.0 -f Dockerfile.web .
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8550
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import http.client; conn=http.client.HTTPConnection('localhost:8550'); conn.request('GET','/'); r=conn.getresponse(); exit(0 if r.status==200 else 1)"
CMD ["streamlit", "run", "app.py", "--server.port", "8550", "--server.address", "0.0.0.0", "--server.headless", "true"]