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:
21
Dockerfile.web
Normal file
21
Dockerfile.web
Normal 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"]
|
||||
Reference in New Issue
Block a user