-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (42 loc) · 1.44 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (42 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
54
55
56
57
58
FROM python:3.13-slim@sha256:c33f0bc4364a6881bed1ec0cc2665e6c53c87a43e774aaeab88e6f17af105e4f
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
LABEL io.modelcontextprotocol.server.name="io.github.hashgraph-online/hol-guard"
WORKDIR /app
COPY docker-requirements.txt LICENSE README.md /app/
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc libc6-dev && \
python3 -m pip install --no-deps --require-hashes -r /app/docker-requirements.txt && \
apt-get purge -y --auto-remove gcc libc6-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY src /app/src
RUN cat <<'EOF' >/usr/local/bin/plugin-scanner
#!/usr/bin/env python3
from __future__ import annotations
import os
import sys
WORKSPACE = "/workspace"
SOURCE_ROOT = "/app/src"
sys.path = [
SOURCE_ROOT,
*[
path
for path in sys.path
if path not in {"", "."}
and os.path.abspath(path or os.curdir) != WORKSPACE
and not os.path.abspath(path or os.curdir).startswith(f"{WORKSPACE}{os.sep}")
],
]
from codex_plugin_scanner.cli import main
raise SystemExit(main())
EOF
RUN chmod 0755 /usr/local/bin/plugin-scanner
RUN groupadd --system scanner && \
useradd --system --gid scanner --create-home --home-dir /home/scanner scanner && \
mkdir -p /workspace && \
chown -R scanner:scanner /workspace /home/scanner
WORKDIR /workspace
USER scanner
ENTRYPOINT ["plugin-scanner"]