4bef241544
- server/api: 注册/登录/登出/会话恢复(JWT + httpOnly Cookie, bcrypt 密码哈希) - server/api: 联系表单与资讯订阅入库,支持 SMTP 邮件通知(可选) - 应用启动自动建表(幂等),docker-compose 新增 PostgreSQL 16 服务 - 前端移除全部 mock:user store、登录注册弹窗、联系表单、页脚订阅接入真实接口 - i18n 补充服务端错误码中英文案,移除 demoHint - deploy: Deployment 环境变量(Secret 引用)、可选集群内 PostgreSQL(postgres.yaml) - 新增 .env.example 与 README/deploy 文档更新
88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
# =========================================================
|
||
# Arcticnewone 可选生产数据库 - PostgreSQL StatefulSet
|
||
#
|
||
# 说明:
|
||
# - 仅当生产环境没有可用的 PostgreSQL(如华为云 RDS)时才使用本文件
|
||
# - 建议优先使用云托管数据库(RDS),自带备份/高可用,运维成本更低
|
||
# - 数据保存在 PVC(8Gi 本地存储类),如需扩容请先调整 storage
|
||
# - 部署后创建 Secret 提供连接信息(见 deploy/README.md)
|
||
# =========================================================
|
||
apiVersion: v1
|
||
kind: Service
|
||
metadata:
|
||
name: arcticnewone-postgres
|
||
namespace: arcticnewone
|
||
labels:
|
||
app: arcticnewone-postgres
|
||
spec:
|
||
clusterIP: None
|
||
ports:
|
||
- name: postgres
|
||
port: 5432
|
||
targetPort: 5432
|
||
selector:
|
||
app: arcticnewone-postgres
|
||
---
|
||
apiVersion: apps/v1
|
||
kind: StatefulSet
|
||
metadata:
|
||
name: arcticnewone-postgres
|
||
namespace: arcticnewone
|
||
labels:
|
||
app: arcticnewone-postgres
|
||
spec:
|
||
serviceName: arcticnewone-postgres
|
||
replicas: 1
|
||
selector:
|
||
matchLabels:
|
||
app: arcticnewone-postgres
|
||
template:
|
||
metadata:
|
||
labels:
|
||
app: arcticnewone-postgres
|
||
spec:
|
||
containers:
|
||
- name: postgres
|
||
image: docker.m.daocloud.io/library/postgres:16-alpine
|
||
ports:
|
||
- name: postgres
|
||
containerPort: 5432
|
||
env:
|
||
- name: POSTGRES_DB
|
||
value: "arcticnewone"
|
||
- name: POSTGRES_USER
|
||
value: "arcticnewone"
|
||
- name: POSTGRES_PASSWORD
|
||
valueFrom:
|
||
secretKeyRef:
|
||
name: arcticnewone-secrets
|
||
key: postgres-password
|
||
volumeMounts:
|
||
- name: data
|
||
mountPath: /var/lib/postgresql/data
|
||
resources:
|
||
requests:
|
||
cpu: 100m
|
||
memory: 256Mi
|
||
limits:
|
||
cpu: 500m
|
||
memory: 1Gi
|
||
readinessProbe:
|
||
exec:
|
||
command: ["pg_isready", "-U", "arcticnewone", "-d", "arcticnewone"]
|
||
initialDelaySeconds: 5
|
||
periodSeconds: 10
|
||
livenessProbe:
|
||
exec:
|
||
command: ["pg_isready", "-U", "arcticnewone", "-d", "arcticnewone"]
|
||
initialDelaySeconds: 15
|
||
periodSeconds: 20
|
||
volumeClaimTemplates:
|
||
- metadata:
|
||
name: data
|
||
spec:
|
||
accessModes: ["ReadWriteOnce"]
|
||
resources:
|
||
requests:
|
||
storage: 8Gi
|