Dockerfile.smitheryā¢1.99 kB
# Simple Dockerfile for EGW Research Server - Smithery optimized
# VERSION: 13 - DOWNLOAD BEFORE COPY
FROM node:22-alpine
# Build argument to bust cache
ARG CACHE_BUST=13
# Install runtime dependencies and bust cache
RUN apk add --no-cache sqlite curl wget && echo "Build v13 - Force download: $(date +%s) - Cache: $CACHE_BUST" > /tmp/build-timestamp.txt
# Create working directory and data directory FIRST
WORKDIR /app/local-server
RUN mkdir -p ./data
# Download the EGW database BEFORE copying any app files
RUN echo "š„ Downloading EGW database from GitHub Release..." && \
wget -O ./data/egw-writings.db "https://github.com/pythondev-pro/egw_writings_mcp_server/releases/download/v1.0.9/egw-writings.db" && \
ls -lh ./data/egw-writings.db && \
DB_SIZE=$(stat -c%s ./data/egw-writings.db 2>/dev/null || stat -f%z ./data/egw-writings.db 2>/dev/null) && \
echo "ā
Database downloaded: $DB_SIZE bytes" && \
if [ "$DB_SIZE" -lt 1073741824 ]; then \
echo "ā Database too small, expected ~1.5GB"; \
exit 1; \
fi
# Verify database integrity
RUN echo "š Verifying database..." && \
sqlite3 ./data/egw-writings.db "PRAGMA integrity_check;" && \
echo "ā
Database verified"
# NOW copy application files
COPY apps/local-server/src ./src
COPY apps/local-server/package.json ./package.json
COPY apps/local-server/package.docker.json ./
# Use Docker-specific package.json
RUN cp package.docker.json package.json
# Install dependencies
RUN npm install
# Create PDF generation directory
RUN mkdir -p /tmp/pdf-generation
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=20s --start-period=30s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
# Default command
CMD ["node", "src/startup.js"]
# Labels
LABEL org.opencontainers.image.title="EGW Research Server"
LABEL org.opencontainers.image.description="Offline API server for EGW research"
LABEL org.opencontainers.image.version="1.0.0"