lawless/docker/postgres/Dockerfile

21 行
793 B
Docker

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

# 《洪荒大陆》本地开发 PostgreSQL 16 镜像
# 基于官方 PostgreSQL 16,自动创建 honghuang 库并执行迁移/seed
FROM postgres:16-alpine
LABEL description="Honghuang local dev PostgreSQL 16 with auto migration"
# 将游戏迁移脚本复制到镜像内(不作为 docker-entrypoint-initdb.d 直接执行,
# 由 init-honghuang.sh 控制目标数据库)
COPY database/migrations /migrations
# 复制本地开发脚本,供初始化阶段调用(如 scripts/seed.sh
COPY scripts /scripts
RUN chmod +x /scripts/*.sh
# 初始化脚本:创建 honghuang 库 -> 执行 up.sql -> 执行 scripts/seed.sh
COPY docker/postgres/init-honghuang.sh /docker-entrypoint-initdb.d/zz-init-honghuang.sh
RUN chmod +x /docker-entrypoint-initdb.d/zz-init-honghuang.sh
EXPOSE 5432