SPipe 데모 v2 (2026-10-30) 서버 배포본
- SPipe_server_2026-10-30.zip 내용을 풀어서 등록 (압축 파일은 올리지 않음) - README에 데모 v2 서버 업데이트 순서 추가, 저장소에 없는 문서 목차 정리 - 패치내역을 docs/로 이동, _worklog.md 추가 - 임시 파일(backend/temp.*)과 API 키가 든 파일은 제외
This commit is contained in:
commit
21ebb16fb7
181 files changed
+57207
No files matched your search
@@ -0,0 +1,30 @@
|
||||
FROM node:24-bookworm-slim AS web-build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY tsconfig.json vite.config.ts index.html ./
|
||||
COPY src ./src
|
||||
COPY public ./public
|
||||
RUN npm run build
|
||||
|
||||
FROM python:3.12-slim-bookworm AS engine-build
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends git cmake build-essential ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
RUN git clone --depth 1 --branch v2.3.5 https://github.com/OpenWaterAnalytics/EPANET.git /engine
|
||||
RUN cmake -S /engine -B /engine/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF && cmake --build /engine/build --target epanet2 -j 2
|
||||
|
||||
FROM python:3.12-slim-bookworm AS api
|
||||
WORKDIR /app
|
||||
COPY backend/requirements-api.txt /tmp/requirements-api.txt
|
||||
RUN pip install --no-cache-dir -r /tmp/requirements-api.txt
|
||||
COPY --from=engine-build /engine/build/lib/libepanet2.so /app/64bit/libepanet2.so
|
||||
COPY backend/__init__.py backend/main.py backend/epanet.py backend/columnar.py backend/batch.py backend/jobs.py backend/gisio.py backend/gisops.py backend/dem.py ./backend/
|
||||
COPY public/Net1.inp /app/smoke.inp
|
||||
RUN python -c "from backend.main import run_epanet; import tempfile; from pathlib import Path; t=tempfile.TemporaryDirectory(); p=Path(t.name); r=run_epanet('/app/smoke.inp',str(p/'test.rpt'),str(p/'test.bin')); assert r['nodes'] and r['links']"
|
||||
RUN useradd --system --uid 10001 spipe && mkdir -p /app/data/dem && chown -R spipe /app/data
|
||||
ENV SPIPE_DEM_DIR=/app/data/dem
|
||||
USER spipe
|
||||
CMD ["python", "-m", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
||||
FROM nginx:stable-bookworm AS web
|
||||
COPY --from=web-build /app/dist /usr/share/nginx/html
|
||||
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
@@ -0,0 +1,26 @@
|
||||
# Ubuntu deployment
|
||||
|
||||
The repository is private. Authenticate on the server using `gh auth login`
|
||||
(GitHub.com, HTTPS, web browser), then run:
|
||||
|
||||
```sh
|
||||
gh repo clone tpstn23-afk/SPipe
|
||||
cd SPipe
|
||||
COMPOSE_PARALLEL_LIMIT=1 docker compose build
|
||||
docker compose up -d
|
||||
curl --fail http://127.0.0.1/api/health
|
||||
```
|
||||
|
||||
Docker Engine and Compose must already be installed. Check free disk space
|
||||
before building; the target server originally had about 4 GB free.
|
||||
Set `SPIPE_PORT=8080` when port 80 is already occupied.
|
||||
|
||||
The API builds the official EPANET v2.3.5 Linux library and runs a Net1
|
||||
analysis while building. Source: https://github.com/OpenWaterAnalytics/EPANET/releases/tag/v2.3.5
|
||||
Only the web/API dependencies are installed; blocksys is a separate CLI.
|
||||
The web and API share one origin through nginx. Only the web port is published.
|
||||
The configuration serves HTTP; domain/TLS setup is a separate server step.
|
||||
Map service allowed domains may need to include the deployed address.
|
||||
|
||||
Validation: local Windows regression suite; Docker build and live server
|
||||
checks still required (Docker is unavailable on the development PC).
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
# Keep in sync with SPIPE_MAX_UPLOAD_MB (backend); nginx rejects larger
|
||||
# bodies before they reach the API.
|
||||
client_max_body_size 21m;
|
||||
gzip on;
|
||||
gzip_types application/json text/plain application/javascript text/css;
|
||||
gzip_min_length 1024;
|
||||
# DEM rasters (SPIPE_MAX_DEM_MB, default 300).
|
||||
location /api/dem {
|
||||
client_max_body_size 301m;
|
||||
proxy_request_buffering off;
|
||||
proxy_pass http://api:8000;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
location /api/ {
|
||||
proxy_pass http://api:8000;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user