forked from coderamp-labs/gitingest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (41 loc) · 1.44 KB
/
Dockerfile
File metadata and controls
53 lines (41 loc) · 1.44 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
# Stage 1: Install Python dependencies
FROM python:3.13.5-slim@sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419 AS python-builder
WORKDIR /build
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends gcc python3-dev; \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml .
COPY src/ ./src/
RUN set -eux; \
pip install --no-cache-dir --upgrade pip; \
pip install --no-cache-dir --timeout 1000 .[server,mcp]
# Stage 2: Runtime image
FROM python:3.13.5-slim@sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419
ARG UID=1000
ARG GID=1000
ARG APP_REPOSITORY=https://github.com/coderamp-labs/gitingest
ARG APP_VERSION=unknown
ARG APP_VERSION_URL=https://github.com/coderamp-labs/gitingest
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
APP_REPOSITORY=${APP_REPOSITORY} \
APP_VERSION=${APP_VERSION} \
APP_VERSION_URL=${APP_VERSION_URL}
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends git curl; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN set -eux; \
groupadd -g "$GID" appuser; \
useradd -m -u "$UID" -g "$GID" appuser
COPY --from=python-builder --chown=$UID:$GID /usr/local/lib/python3.13/site-packages/ /usr/local/lib/python3.13/site-packages/
COPY --chown=$UID:$GID src/ ./
RUN set -eux; \
chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
EXPOSE 9090
CMD ["python", "-m", "server"]