fix(auth): 更新数据库配置并修正Dockerfile文件路径

将PostgreSQL和Redis的host从本地地址更新为服务名称
修正Dockerfile中的文件拷贝路径和启动命令
添加swagger-ui静态文件拷贝配置
This commit is contained in:
jayhgq 2026-03-28 00:19:26 +08:00
parent 001d0abca2
commit e9ef32a215
9 changed files with 11 additions and 4 deletions

View File

@ -5,8 +5,10 @@ WORKDIR /home/booksystem/auth
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
COPY .. . COPY . .
COPY swagger-ui /home/booksystem/swagger-ui
EXPOSE 8000 EXPOSE 8000
CMD ["python", "app.py"] CMD ["python", "main.py"]

View File

@ -6,7 +6,7 @@ from urllib.parse import quote_plus
class PostgreSQLSettings(BaseSettings): class PostgreSQLSettings(BaseSettings):
"""PostgreSQL数据库配置""" """PostgreSQL数据库配置"""
host: str = "127.0.0.1" host: str = "postgres"
port: int = 5432 port: int = 5432
user: str = "admin" user: str = "admin"
password: str = "PostgresAdmin@123" password: str = "PostgresAdmin@123"
@ -27,7 +27,7 @@ class PostgreSQLSettings(BaseSettings):
class RedisSettings(BaseSettings): class RedisSettings(BaseSettings):
"""Redis配置""" """Redis配置"""
host: str = "127.0.0.1" host: str = "redis"
port: int = 6379 port: int = 6379
password: Optional[str] = "RedisAdmin@123" password: Optional[str] = "RedisAdmin@123"
db: int = 0 db: int = 0

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long