Initial commit
This commit is contained in:
36
Dockerfile.prebuilt
Normal file
36
Dockerfile.prebuilt
Normal file
@@ -0,0 +1,36 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# ---------------------------------------------------------------------------
|
||||
# danbooru-mcp — Fast Dockerfile (uses a pre-built db/tags.db)
|
||||
#
|
||||
# Use this when you already have db/tags.db built locally via:
|
||||
# python scripts/scrape_tags.py
|
||||
#
|
||||
# Build:
|
||||
# docker build -f Dockerfile.prebuilt -t danbooru-mcp .
|
||||
#
|
||||
# Run (MCP stdio):
|
||||
# docker run --rm -i danbooru-mcp
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
ARG PYTHON_VERSION=3.12
|
||||
|
||||
FROM python:${PYTHON_VERSION}-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY src/ src/
|
||||
COPY db/tags.db db/tags.db
|
||||
|
||||
ENV DANBOORU_TAGS_DB=/app/db/tags.db
|
||||
|
||||
RUN useradd --no-create-home --shell /bin/false mcpuser && \
|
||||
chown -R mcpuser:mcpuser /app
|
||||
USER mcpuser
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||
CMD python -c "import sqlite3; c=sqlite3.connect('/app/db/tags.db'); print(c.execute('SELECT COUNT(*) FROM tags').fetchone()[0]); c.close()"
|
||||
|
||||
ENTRYPOINT ["python", "src/server.py"]
|
||||
Reference in New Issue
Block a user