-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 1.06 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) · 1.06 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
FROM node:20-alpine
# Install Python runtime for sniper/orchestrator engines
RUN apk add --no-cache python3 py3-pip \
&& ln -sf python3 /usr/bin/python
# Use backend repo as build context; place it under /app/backend to match runtime paths
WORKDIR /app
# Copy everything from backend context into /app/backend
COPY . ./backend
# Install deps inside backend folder
WORKDIR /app/backend
RUN npm ci --omit=dev
# Install Python deps (core + scanner) inside a venv to satisfy PEP 668
RUN python3 -m venv /py \
&& . /py/bin/activate \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir -r scanner/requirements.txt
# Ensure the venv binaries (python/pip) are first on PATH so fallbacks use the
# environment where httpx and other scanner deps are installed.
ENV PATH="/py/bin:${PATH}"
# Run from /app so process.cwd() is /app and allowlist.ts resolves /app/backend/scanner/allowlist.json
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=8080
ENV FORCE_STATIC=1
ENV PYTHON_BIN=/py/bin/python
EXPOSE 8080
CMD ["npx", "tsx", "backend/server/index.ts"]