-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 830 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (25 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM --platform=linux/amd64 python:3.11-slim
WORKDIR /app
# Install minimal dependencies and clean up
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc g++ && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
# Copy all necessary files at once
COPY . .
# Install dependencies
RUN pip install --no-cache-dir uv && \
uv pip install --system --no-cache . && \
pip uninstall -y uv && \
apt-get purge -y gcc g++ && \
apt-get autoremove -y && \
rm -rf /root/.cache /tmp/*
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Create non-root user and set up permissions
RUN useradd -r -s /bin/false appuser && \
chown -R appuser:appuser /app && \
chmod -R 755 /app
USER appuser
# MCP stdio mode
ENTRYPOINT ["python", "-m", "shioaji_mcp.server"]