forked from IBM/mcp-context-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
43 lines (32 loc) · 1.31 KB
/
Copy pathContainerfile
File metadata and controls
43 lines (32 loc) · 1.31 KB
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
33
34
35
36
37
38
39
40
41
42
43
FROM registry.access.redhat.com/ubi10-minimal:10.0-1755721767
LABEL maintainer="Mihai Criveti" \
name="mcp/mcpgateway" \
version="0.7.0" \
description="MCP Gateway: An enterprise-ready Model Context Protocol Gateway"
ARG PYTHON_VERSION=3.12
# Install Python and build dependencies
# hadolint ignore=DL3041
RUN microdnf update -y && \
microdnf install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-devel gcc git && \
microdnf clean all
# Set default python3 to the specified version
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
WORKDIR /app
# Copy project files into container
COPY . /app
# Create virtual environment, upgrade pip and install dependencies using uv for speed
# Including observability packages for OpenTelemetry support
RUN python3 -m venv /app/.venv && \
/app/.venv/bin/python3 -m pip install --upgrade pip setuptools pdm uv && \
/app/.venv/bin/python3 -m uv pip install ".[redis,postgres,mysql,alembic,observability]"
# update the user permissions
RUN chown -R 1001:0 /app && \
chmod -R g=u /app
# Expose the application port
EXPOSE 4444
# Set the runtime user
USER 1001
# Ensure virtual environment binaries are in PATH
ENV PATH="/app/.venv/bin:$PATH"
# Start the application using run-gunicorn.sh
CMD ["./run-gunicorn.sh"]