fix Deployment
This commit is contained in:
@@ -43,10 +43,6 @@ RUN apk --no-cache add tzdata curl
|
|||||||
# 设置时区
|
# 设置时区
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
|
|
||||||
# 创建非root用户
|
|
||||||
RUN addgroup -g 1001 tyapi && \
|
|
||||||
adduser -D -s /bin/sh -u 1001 -G tyapi tyapi
|
|
||||||
|
|
||||||
# 设置工作目录
|
# 设置工作目录
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -57,11 +53,6 @@ COPY --from=builder /app/tyapi-server .
|
|||||||
COPY --chown=tyapi:tyapi config.yaml .
|
COPY --chown=tyapi:tyapi config.yaml .
|
||||||
COPY --chown=tyapi:tyapi configs/ ./configs/
|
COPY --chown=tyapi:tyapi configs/ ./configs/
|
||||||
|
|
||||||
# 创建日志目录
|
|
||||||
RUN mkdir -p logs && chown -R tyapi:tyapi logs
|
|
||||||
|
|
||||||
# 使用root权限运行(注释掉非root用户)
|
|
||||||
# USER tyapi
|
|
||||||
|
|
||||||
# 暴露端口
|
# 暴露端口
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ cache:
|
|||||||
logger:
|
logger:
|
||||||
level: "info"
|
level: "info"
|
||||||
format: "console"
|
format: "console"
|
||||||
output: "stdout"
|
output: "file"
|
||||||
log_dir: "logs"
|
log_dir: "logs"
|
||||||
max_size: 100
|
max_size: 100
|
||||||
max_backups: 3
|
max_backups: 3
|
||||||
|
|||||||
@@ -15,6 +15,19 @@ database:
|
|||||||
name: "tyapi_dev"
|
name: "tyapi_dev"
|
||||||
|
|
||||||
# ===========================================
|
# ===========================================
|
||||||
|
# 📝 日志配置
|
||||||
|
# ===========================================
|
||||||
|
logger:
|
||||||
|
level: info
|
||||||
|
format: json
|
||||||
|
output: "file"
|
||||||
|
log_dir: "logs"
|
||||||
|
max_size: 100
|
||||||
|
max_backups: 5
|
||||||
|
max_age: 30
|
||||||
|
compress: true
|
||||||
|
use_daily: true
|
||||||
|
# ===========================================
|
||||||
# 🔐 JWT配置
|
# 🔐 JWT配置
|
||||||
# ===========================================
|
# ===========================================
|
||||||
jwt:
|
jwt:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ redis:
|
|||||||
# 📝 日志配置
|
# 📝 日志配置
|
||||||
# ===========================================
|
# ===========================================
|
||||||
logger:
|
logger:
|
||||||
level: warn
|
level: info
|
||||||
format: json
|
format: json
|
||||||
output: "file"
|
output: "file"
|
||||||
log_dir: "/app/logs"
|
log_dir: "/app/logs"
|
||||||
|
|||||||
@@ -85,40 +85,6 @@ services:
|
|||||||
|
|
||||||
# 环境设置
|
# 环境设置
|
||||||
ENV: production
|
ENV: production
|
||||||
|
|
||||||
# 服务器配置
|
|
||||||
SERVER_PORT: 8080
|
|
||||||
SERVER_MODE: release
|
|
||||||
|
|
||||||
# 数据库配置
|
|
||||||
DB_HOST: postgres
|
|
||||||
DB_PORT: 5432
|
|
||||||
DB_USER: tyapi_user
|
|
||||||
DB_PASSWORD: Pg9mX4kL8nW2rT5y
|
|
||||||
DB_NAME: tyapi
|
|
||||||
DB_SSLMODE: require
|
|
||||||
|
|
||||||
# Redis配置
|
|
||||||
REDIS_HOST: redis
|
|
||||||
REDIS_PORT: 6379
|
|
||||||
REDIS_PASSWORD: ""
|
|
||||||
|
|
||||||
# JWT配置
|
|
||||||
JWT_SECRET: JwT8xR4mN9vP2sL7kH3oB6yC1zA5uF0qE9tW
|
|
||||||
|
|
||||||
# 监控配置
|
|
||||||
TRACING_ENABLED: false
|
|
||||||
METRICS_ENABLED: false
|
|
||||||
|
|
||||||
# 日志配置
|
|
||||||
LOG_LEVEL: warn
|
|
||||||
LOG_FORMAT: json
|
|
||||||
|
|
||||||
# 短信配置
|
|
||||||
SMS_ACCESS_KEY_ID: LTAI5tKGB3TVJbMHSoZN3yr9
|
|
||||||
SMS_ACCESS_KEY_SECRET: OCQ30GWp4yENMjmfOAaagksE18bp65
|
|
||||||
SMS_SIGN_NAME: 天远数据
|
|
||||||
SMS_TEMPLATE_CODE: SMS_474525324
|
|
||||||
ports:
|
ports:
|
||||||
- "25000:8080"
|
- "25000:8080"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user