-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 1.14 KB
/
Copy pathDockerfile
File metadata and controls
27 lines (20 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM python:3.12-slim
WORKDIR /app
# COPY . . lands the repo root in /app, so the package itself sits at /app/app.
# Streamlit puts the SCRIPT's directory (/app/app) on sys.path, not the working dir,
# so `import app.agent.orchestrator` can't resolve. Celery doesn't hit this because it
# runs from the working dir. Pinning PYTHONPATH makes both entry points agree.
ENV PYTHONPATH=/app
# No build toolchain needed: psycopg2-binary ships prebuilt wheels, and every other
# dependency is pure Python or wheel-distributed. Dropping gcc keeps the image small.
# Copy requirements first, on its own layer. Docker caches layers, so as long as
# requirements.txt is unchanged, `pip install` is skipped on rebuild — even when
# application code changes. Copying everything up front would bust that cache
# on every single edit.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Application code. See .dockerignore — .env and the local venvs are excluded,
# so no secrets or host-built binaries get baked into the image layers.
COPY . .
EXPOSE 8501
CMD ["streamlit", "run", "app/ui.py", "--server.address=0.0.0.0", "--server.port=8501"]