Skip to content

Commit 9bc8fb8

Browse files
authored
Merge pull request #49 from eifrach/ubi_image_pip
moving to UBI image and pip
2 parents b4a5d72 + 99de61a commit 9bc8fb8

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12
1+
3.11

Containerfile

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,12 @@
1-
FROM quay.io/centos/centos:stream9
1+
FROM registry.redhat.io/ubi9/python-311
22

33
# Set default MCP transport if not provided
44
ENV MCP_TRANSPORT=stdio
55

6-
# Install Python 3.11, pip, and build dependencies
7-
RUN dnf -y install --setopt=install_weak_deps=False --setopt=tsflags=nodocs \
8-
python3.12 python3.12-devel python3.12-pip gcc make git && \
9-
dnf clean all
10-
11-
# Install uv (universal virtualenv/dependency manager)
12-
RUN pip3.12 install --no-cache-dir --upgrade pip && \
13-
pip3.12 install --no-cache-dir uv
14-
15-
# Copy project files to working directory
16-
WORKDIR /app
17-
18-
# Set ownership to the user we created. Group 0 (root) is important for OpenShift compatibility.
19-
RUN chown -R 1001:0 /app && \
20-
chgrp -R 0 /app && \
21-
chmod -R g+rwX /app
22-
23-
# Switch to the non-root user *before* copying files and installing dependencies
24-
USER 1001
25-
26-
COPY pyproject.toml ./
27-
COPY .python-version ./
28-
COPY uv.lock ./
29-
COPY README.md ./
30-
# Copy application files (needed for editable install)
31-
COPY ./src/ ./
32-
6+
COPY . .
337
# Install dependencies
34-
RUN uv sync --no-cache --locked && \
35-
chgrp -R 0 /app && \
36-
chmod -R g+rwX /app
8+
9+
RUN pip install --no-cache-dir .
3710

3811
# Environment variables (set these when running the container)
3912
# SNOWFLAKE_BASE_URL - Snowflake API base URL (optional, defaults to Red Hat's instance)
@@ -45,4 +18,4 @@ RUN uv sync --no-cache --locked && \
4518
# Expose metrics port
4619
EXPOSE 8000
4720

48-
CMD ["uv", "run", "--no-cache", "python", "mcp_server.py"]
21+
CMD ["python", "src/mcp_server.py"]

0 commit comments

Comments
 (0)