updates on the dockerfile and the dockerignore file

This commit is contained in:
sriram
2026-08-12 11:22:41 +05:30
parent c2af4556c6
commit eb3567df62
2 changed files with 33 additions and 0 deletions

8
.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
venv
__pycache__
*.pyc
.pytest_cache
*.log
.env
.git
tests

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM python:3.11-slim
WORKDIR /app
# psycopg[binary] avoids needing libpq-dev; sentence-transformers/scikit-learn/
# scipy all ship prebuilt wheels for this image, so no extra build toolchain
# is needed. Playwright's Python package installs, but its browser binary is
# NOT installed here - it's only a last-resort image-search fallback
# (see requirements.txt); run `playwright install chromium` in the container
# if you need that specific fallback tier.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
COPY cli ./cli
COPY scripts ./scripts
COPY data ./data
EXPOSE 8000
# --proxy-headers/--forwarded-allow-ips: this container is never reached
# directly - nginx (and, in prod, Caddy) sit in front of it. Without these,
# uvicorn ignores X-Forwarded-Proto and reports every request as plain http,
# so any redirect or generated absolute URL would downgrade an https request.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", \
"--proxy-headers", "--forwarded-allow-ips", "*"]