-
Notifications
You must be signed in to change notification settings - Fork 252
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 938 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (22 loc) · 938 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Python image from the Docker Hub
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install the dependencies specified in the requirements file
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY src/ /app/src
ENV PYTHONPATH=/app/src
# Create a non-root user for security
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
# NOTE: Do NOT set MYSQL_PASSWORD or other secrets as ENV here.
# Pass secrets at runtime via `docker run -e MYSQL_PASSWORD=...`
# or use Docker secrets / environment files.
ENV MYSQL_HOST=host.docker.internal
ENV MYSQL_PORT=3306
# Command to run the server
CMD ["python", "-m", "mysql_mcp_server.server"]