# 《洪荒大陆》本地开发 PostgreSQL 16 镜像 # 基于官方 PostgreSQL 16,自动创建 honghuang 库并执行迁移/seed FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/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