Spaces:
Running
Running
ztothez commited on
Commit ·
ed2a586
1
Parent(s): a32ebba
chore: convert Hugging Face Space to Docker
Browse files- .dockerignore +53 -0
- Dockerfile +43 -0
- README.md +2 -4
- docker/nginx.conf +50 -0
- docker/supervisord.conf +31 -0
- frontend/src/app/globals.css +1 -0
- requirements.txt +2 -0
.dockerignore
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.gitignore
|
| 3 |
+
.dockerignore
|
| 4 |
+
|
| 5 |
+
venv/
|
| 6 |
+
.venv/
|
| 7 |
+
env/
|
| 8 |
+
__pycache__/
|
| 9 |
+
*.pyc
|
| 10 |
+
.pytest_cache/
|
| 11 |
+
.coverage
|
| 12 |
+
htmlcov/
|
| 13 |
+
|
| 14 |
+
node_modules/
|
| 15 |
+
frontend/node_modules/
|
| 16 |
+
.next/
|
| 17 |
+
frontend/.next/
|
| 18 |
+
frontend/out/
|
| 19 |
+
out/
|
| 20 |
+
.turbo/
|
| 21 |
+
frontend/.turbo/
|
| 22 |
+
|
| 23 |
+
.env
|
| 24 |
+
.env.local
|
| 25 |
+
.env.*.local
|
| 26 |
+
frontend/.env
|
| 27 |
+
frontend/.env.local
|
| 28 |
+
frontend/.env.*.local
|
| 29 |
+
|
| 30 |
+
*.zip
|
| 31 |
+
*.log
|
| 32 |
+
logs/
|
| 33 |
+
AegisOps.zip
|
| 34 |
+
Code/
|
| 35 |
+
design_assets/
|
| 36 |
+
assets/figma/
|
| 37 |
+
apply_ui_patch.py
|
| 38 |
+
ui_template.py
|
| 39 |
+
|
| 40 |
+
.DS_Store
|
| 41 |
+
Thumbs.db
|
| 42 |
+
.idea/
|
| 43 |
+
.vscode/
|
| 44 |
+
|
| 45 |
+
sigma_*.yml
|
| 46 |
+
splunk_*.spl
|
| 47 |
+
vectr_*.json
|
| 48 |
+
validation_*.json
|
| 49 |
+
aegisops_*.pdf
|
| 50 |
+
report_*.pdf
|
| 51 |
+
docs/*.pdf
|
| 52 |
+
docs/*.png
|
| 53 |
+
docs/design/
|
Dockerfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:22-bookworm AS frontend-build
|
| 2 |
+
|
| 3 |
+
WORKDIR /app/frontend
|
| 4 |
+
COPY frontend/package*.json ./
|
| 5 |
+
RUN npm ci
|
| 6 |
+
COPY frontend ./
|
| 7 |
+
RUN npm run build
|
| 8 |
+
RUN npm prune --omit=dev
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
FROM python:3.12-slim AS runtime
|
| 12 |
+
|
| 13 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 14 |
+
ENV PYTHONUNBUFFERED=1
|
| 15 |
+
ENV NODE_ENV=production
|
| 16 |
+
|
| 17 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 18 |
+
nginx \
|
| 19 |
+
nodejs \
|
| 20 |
+
npm \
|
| 21 |
+
supervisor \
|
| 22 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
+
|
| 24 |
+
RUN useradd -m -u 1000 user
|
| 25 |
+
WORKDIR /home/user/app
|
| 26 |
+
|
| 27 |
+
COPY --chown=user:user requirements.txt ./
|
| 28 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 29 |
+
pip install --no-cache-dir -r requirements.txt
|
| 30 |
+
|
| 31 |
+
COPY --chown=user:user . .
|
| 32 |
+
|
| 33 |
+
COPY --from=frontend-build --chown=user:user /app/frontend/.next ./frontend/.next
|
| 34 |
+
COPY --from=frontend-build --chown=user:user /app/frontend/public ./frontend/public
|
| 35 |
+
COPY --from=frontend-build --chown=user:user /app/frontend/package*.json ./frontend/
|
| 36 |
+
COPY --from=frontend-build --chown=user:user /app/frontend/node_modules ./frontend/node_modules
|
| 37 |
+
|
| 38 |
+
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
| 39 |
+
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 40 |
+
|
| 41 |
+
EXPOSE 7860
|
| 42 |
+
|
| 43 |
+
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
README.md
CHANGED
|
@@ -3,10 +3,8 @@ title: AegisOps AI
|
|
| 3 |
emoji: 🛡️
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: red
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
python_version: "3.12"
|
| 9 |
-
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
| 12 |
---
|
|
|
|
| 3 |
emoji: 🛡️
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: red
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
---
|
docker/nginx.conf
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
events {}
|
| 2 |
+
|
| 3 |
+
http {
|
| 4 |
+
server {
|
| 5 |
+
listen 7860;
|
| 6 |
+
|
| 7 |
+
client_max_body_size 50m;
|
| 8 |
+
|
| 9 |
+
location /health {
|
| 10 |
+
proxy_pass http://127.0.0.1:8000/health;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
location /model-routing {
|
| 14 |
+
proxy_pass http://127.0.0.1:8000/model-routing;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
location /run {
|
| 18 |
+
proxy_pass http://127.0.0.1:8000/run;
|
| 19 |
+
proxy_buffering off;
|
| 20 |
+
proxy_cache off;
|
| 21 |
+
proxy_set_header Connection "";
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
location /api/ {
|
| 25 |
+
proxy_pass http://127.0.0.1:8000/api/;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
location /export/ {
|
| 29 |
+
proxy_pass http://127.0.0.1:8000/export/;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
location /topology {
|
| 33 |
+
proxy_pass http://127.0.0.1:8000/topology;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
location /intel/ {
|
| 37 |
+
proxy_pass http://127.0.0.1:8000/intel/;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
location /assets/ {
|
| 41 |
+
proxy_pass http://127.0.0.1:8000/assets/;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
location / {
|
| 45 |
+
proxy_pass http://127.0.0.1:3000;
|
| 46 |
+
proxy_set_header Host $host;
|
| 47 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
docker/supervisord.conf
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[supervisord]
|
| 2 |
+
nodaemon=true
|
| 3 |
+
|
| 4 |
+
[program:backend]
|
| 5 |
+
directory=/home/user/app
|
| 6 |
+
command=python -m uvicorn server:api --host 127.0.0.1 --port 8000
|
| 7 |
+
autostart=true
|
| 8 |
+
autorestart=true
|
| 9 |
+
stdout_logfile=/dev/stdout
|
| 10 |
+
stderr_logfile=/dev/stderr
|
| 11 |
+
stdout_logfile_maxbytes=0
|
| 12 |
+
stderr_logfile_maxbytes=0
|
| 13 |
+
|
| 14 |
+
[program:frontend]
|
| 15 |
+
directory=/home/user/app/frontend
|
| 16 |
+
command=npm run start -- --hostname 127.0.0.1 --port 3000
|
| 17 |
+
autostart=true
|
| 18 |
+
autorestart=true
|
| 19 |
+
stdout_logfile=/dev/stdout
|
| 20 |
+
stderr_logfile=/dev/stderr
|
| 21 |
+
stdout_logfile_maxbytes=0
|
| 22 |
+
stderr_logfile_maxbytes=0
|
| 23 |
+
|
| 24 |
+
[program:nginx]
|
| 25 |
+
command=nginx -g "daemon off;"
|
| 26 |
+
autostart=true
|
| 27 |
+
autorestart=true
|
| 28 |
+
stdout_logfile=/dev/stdout
|
| 29 |
+
stderr_logfile=/dev/stderr
|
| 30 |
+
stdout_logfile_maxbytes=0
|
| 31 |
+
stderr_logfile_maxbytes=0
|
frontend/src/app/globals.css
CHANGED
|
@@ -42,6 +42,7 @@
|
|
| 42 |
--color-aegis-amber-soft: #FCD34D;
|
| 43 |
--color-aegis-red: #EF4444;
|
| 44 |
--color-aegis-red-soft: #FCA5A5;
|
|
|
|
| 45 |
|
| 46 |
/* Tinted fills */
|
| 47 |
--color-aegis-tint-purple: rgba(139, 92, 246, 0.12);
|
|
|
|
| 42 |
--color-aegis-amber-soft: #FCD34D;
|
| 43 |
--color-aegis-red: #EF4444;
|
| 44 |
--color-aegis-red-soft: #FCA5A5;
|
| 45 |
+
--color-aegis-purple-deep: #7C3AED;
|
| 46 |
|
| 47 |
/* Tinted fills */
|
| 48 |
--color-aegis-tint-purple: rgba(139, 92, 246, 0.12);
|
requirements.txt
CHANGED
|
@@ -93,3 +93,5 @@ wheel==0.47.0
|
|
| 93 |
xlsxwriter==3.2.9
|
| 94 |
xxhash==3.6.0
|
| 95 |
zstandard==0.25.0
|
|
|
|
|
|
|
|
|
| 93 |
xlsxwriter==3.2.9
|
| 94 |
xxhash==3.6.0
|
| 95 |
zstandard==0.25.0
|
| 96 |
+
uvicorn[standard]
|
| 97 |
+
fastapi
|