feat: add new folder
This commit is contained in:
52
gig-poc/infrastructure/docker-compose.prod.yml
Normal file
52
gig-poc/infrastructure/docker-compose.prod.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: gig-poc-prod
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: docker.m.daocloud.io/library/postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-gig_poc}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-gig}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-gig}
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- postgres_prod_data:/var/lib/postgresql/data
|
||||
- ./sql:/docker-entrypoint-initdb.d
|
||||
|
||||
qdrant:
|
||||
image: docker.m.daocloud.io/qdrant/qdrant:v1.14.1
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- qdrant_prod_data:/qdrant/storage
|
||||
|
||||
api:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: apps/api/Dockerfile
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
APP_ENV: production
|
||||
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-gig}:${POSTGRES_PASSWORD:-gig}@postgres:5432/${POSTGRES_DB:-gig_poc}
|
||||
QDRANT_URL: http://qdrant:6333
|
||||
LOG_LEVEL: INFO
|
||||
LLM_ENABLED: ${LLM_ENABLED:-false}
|
||||
LLM_BASE_URL: ${LLM_BASE_URL:-}
|
||||
LLM_API_KEY: ${LLM_API_KEY:-}
|
||||
LLM_MODEL: ${LLM_MODEL:-gpt-5.4}
|
||||
depends_on:
|
||||
- postgres
|
||||
- qdrant
|
||||
|
||||
web:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: apps/web/Dockerfile
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- api
|
||||
ports:
|
||||
- "${WEB_PORT:-80}:80"
|
||||
|
||||
volumes:
|
||||
postgres_prod_data:
|
||||
qdrant_prod_data:
|
||||
59
gig-poc/infrastructure/docker-compose.yml
Normal file
59
gig-poc/infrastructure/docker-compose.yml
Normal file
@@ -0,0 +1,59 @@
|
||||
name: gig-poc
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: docker.m.daocloud.io/library/postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_DB: gig_poc
|
||||
POSTGRES_USER: gig
|
||||
POSTGRES_PASSWORD: gig
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./sql:/docker-entrypoint-initdb.d
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U gig -d gig_poc"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
qdrant:
|
||||
image: docker.m.daocloud.io/qdrant/qdrant:v1.14.1
|
||||
volumes:
|
||||
- qdrant_data:/qdrant/storage
|
||||
ports:
|
||||
- "6333:6333"
|
||||
|
||||
api:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: apps/api/Dockerfile
|
||||
environment:
|
||||
APP_ENV: docker
|
||||
DATABASE_URL: postgresql+psycopg://gig:gig@postgres:5432/gig_poc
|
||||
QDRANT_URL: http://qdrant:6333
|
||||
LOG_LEVEL: INFO
|
||||
LLM_ENABLED: "false"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
qdrant:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
web:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: apps/web/Dockerfile
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "5173:80"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
qdrant_data:
|
||||
25
gig-poc/infrastructure/nginx/default.conf
Normal file
25
gig-poc/infrastructure/nginx/default.conf
Normal file
@@ -0,0 +1,25 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /docs {
|
||||
proxy_pass http://api:8000/docs;
|
||||
}
|
||||
|
||||
location /openapi.json {
|
||||
proxy_pass http://api:8000/openapi.json;
|
||||
}
|
||||
}
|
||||
16
gig-poc/infrastructure/scripts/dev-up.sh
Executable file
16
gig-poc/infrastructure/scripts/dev-up.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
INFRA_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
cd "$INFRA_DIR"
|
||||
docker compose -f docker-compose.yml up --build -d
|
||||
echo "等待 API 健康检查..."
|
||||
until curl -fsS http://127.0.0.1:8000/health >/dev/null 2>&1; do
|
||||
sleep 3
|
||||
done
|
||||
until curl -fsS -X POST http://127.0.0.1:8000/poc/ingest/bootstrap >/dev/null 2>&1; do
|
||||
sleep 3
|
||||
done
|
||||
echo "本地环境已启动。Web: http://127.0.0.1:5173 API: http://127.0.0.1:8000/docs"
|
||||
8
gig-poc/infrastructure/scripts/down.sh
Executable file
8
gig-poc/infrastructure/scripts/down.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
INFRA_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
cd "$INFRA_DIR"
|
||||
docker compose -f docker-compose.yml down
|
||||
9
gig-poc/infrastructure/scripts/prod-up.sh
Executable file
9
gig-poc/infrastructure/scripts/prod-up.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
INFRA_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
cd "$INFRA_DIR"
|
||||
docker compose -f docker-compose.prod.yml up --build -d
|
||||
echo "生产部署容器已启动。请按实际域名或端口访问 Web。"
|
||||
1
gig-poc/infrastructure/sql/01-init.sql
Normal file
1
gig-poc/infrastructure/sql/01-init.sql
Normal file
@@ -0,0 +1 @@
|
||||
SET TIME ZONE 'Asia/Shanghai';
|
||||
Reference in New Issue
Block a user