feat: Add docker support

This commit is contained in:
vimukthiRajapaksha
2025-06-26 22:51:04 +05:30
parent bd664e439c
commit 1503d15382
2 changed files with 72 additions and 0 deletions

45
.dockerignore Normal file
View File

@@ -0,0 +1,45 @@
# Ignore Python cache and build artifacts
__pycache__/
*.pyc
*.pyo
*.pyd
*.py[co]
# Ignore virtual environments
.venv/
venv/
ENV/
# Ignore distribution/build directories
build/
dist/
wheels/
*.egg-info/
# Ignore environment files
.env
*.env
# Ignore IDE/editor config
.vscode/
.idea/
# Ignore OS files
.DS_Store
Thumbs.db
# Ignore test and coverage outputs
.coverage
htmlcov/
.tox/
# Ignore git and docker files
.git
.gitignore
.dockerignore
# Ignore logs
*.log
# Ignore documentation builds
docs/_build/

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM python:3.11-slim
# Install uv (for fast dependency management)
RUN pip install --upgrade pip && pip install uv
# Set workdir
WORKDIR /app
# Copy only requirements first for better caching
COPY requirements.txt ./
RUN uv pip sync --system requirements.txt
# Copy the rest of the code
COPY . .
# Create a non-root user with UID 10001 and switch to it
RUN useradd -m -u 10001 appuser
USER 10001
# Expose default port
EXPOSE 8000
# Set environment variables (can be overridden at runtime)
ENV PYTHONUNBUFFERED=1
# Default command to run the server (can be overridden)
CMD ["uv", "run", "fhir-mcp-server", "--disable-mcp-auth"]