-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (41 loc) · 1.69 KB
/
Dockerfile
File metadata and controls
59 lines (41 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM python:3.12-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV UV_COMPILE_BYTECODE=1
WORKDIR /app
COPY pyproject.toml uv.lock README.md /app/
COPY src /app/src
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --no-editable
FROM python:3.12-slim AS runtime-base
ENV PATH="/app/.venv/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
IDFKIT_MCP_TRANSPORT=http \
IDFKIT_MCP_HOST=0.0.0.0 \
IDFKIT_MCP_PORT=8000
WORKDIR /app
RUN useradd --create-home --uid 10001 appuser
EXPOSE 8000
ENTRYPOINT ["idfkit-mcp"]
FROM runtime-base AS sim-base
ARG ENERGYPLUS_TARBALL_URL
ARG ENERGYPLUS_TARBALL_SHA256
RUN test -n "$ENERGYPLUS_TARBALL_URL" || (echo "ENERGYPLUS_TARBALL_URL is required for sim target" && exit 1)
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget libx11-6 libgomp1 \
&& rm -rf /var/lib/apt/lists/*
RUN wget -O /tmp/energyplus.tar.gz "$ENERGYPLUS_TARBALL_URL" \
&& if [ -n "$ENERGYPLUS_TARBALL_SHA256" ]; then echo "$ENERGYPLUS_TARBALL_SHA256 /tmp/energyplus.tar.gz" | sha256sum -c -; fi \
&& mkdir -p /opt/EnergyPlus \
&& tar -xzf /tmp/energyplus.tar.gz -C /opt/EnergyPlus --strip-components=1 \
&& rm -f /tmp/energyplus.tar.gz \
&& test -x /opt/EnergyPlus/energyplus \
&& /opt/EnergyPlus/energyplus --version >/dev/null \
&& chown -R appuser:appuser /opt/EnergyPlus
ENV ENERGYPLUS_DIR=/opt/EnergyPlus \
PATH="/opt/EnergyPlus:${PATH}"
FROM sim-base AS sim
COPY --from=builder --chown=appuser:appuser /app/.venv /app/.venv
USER appuser
FROM runtime-base AS runtime
COPY --from=builder --chown=appuser:appuser /app/.venv /app/.venv
USER appuser