- 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
21 lines
708 B
Docker
21 lines
708 B
Docker
# 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"] |