mirror of
https://github.com/wahyd4/hey-search.git
synced 2026-08-08 21:05:14 +10:00
- DB path now uses DATA_DIR env var (defaults to backend/data/ for local dev) - Dockerfile sets DATA_DIR=/app/data with VOLUME declaration - Docker run examples show -v mount for persistence across restarts - /app/data stores SQLite DB (engines, excluded domains, cache settings) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
35 lines
902 B
Docker
35 lines
902 B
Docker
# Stage 1: Build frontend
|
|
FROM node:20-slim AS frontend-build
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
RUN npm ci
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Python backend
|
|
FROM python:3.12-slim AS production
|
|
WORKDIR /app
|
|
|
|
# Install uv and system deps for lxml
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libxml2 libxslt1.1 && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY backend/pyproject.toml backend/uv.lock ./
|
|
RUN uv sync --frozen --no-dev
|
|
|
|
COPY backend/ .
|
|
|
|
# Copy frontend build output to static dir
|
|
COPY --from=frontend-build /app/frontend/dist /app/static
|
|
|
|
# Persistent data directory for SQLite DB and configuration
|
|
ENV DATA_DIR=/app/data
|
|
ENV REDIS_URL=""
|
|
VOLUME ["/app/data"]
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|