Files
ulthon_admin/source/stack/author/Dockerfile
augushong 544604ebff fix(stack): 其余4个模式同步 bind mount 兼容修复
与 docker-dev(commit 5797885)保持一致的修复方案:
- run.sh 改为 SCRIPT_DIR 自动检测脚本所在目录
- Dockerfile ENTRYPOINT/chmod 改为完整路径
  /var/www/html/source/stack/<mode>/source/docker/run.sh
- 基础配置(nginx.conf/zz-phprun.ini/zz-phpfpm.conf)复制到各模式目录
- ln -s 改为 ln -sf(防止容器重启时 File exists)

docker-dev-sync 额外保留 sync.sh 调用逻辑(init + watch),
仅路径改为 \/sync.sh
2026-07-22 23:40:33 +08:00

38 lines
1.3 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ARG BASE_IMAGE=ulthon/ulthon_admin-base:latest
FROM ${BASE_IMAGE}
# 设置工作目录
WORKDIR /var/www/html
# 预先拷贝 composer 文件并安装依赖,利用 Docker 缓存
COPY composer.json composer.lock /var/www/html/
RUN composer install --no-dev --no-interaction --no-scripts --no-autoloader
# 将当前目录下的文件拷贝到工作目录
COPY . /var/www/html
# B-route: build context 为仓库根,模式配置在 source/stack/<mode>/source/docker/
RUN rm -rf /var/www/html/source/docker && ln -sf /var/www/html/source/stack/author/source/docker /var/www/html/source/docker
# 生成自动加载文件
RUN composer dump-autoload --optimize --no-dev --classmap-authoritative
VOLUME /var/www/html/runtime
VOLUME /var/www/html/public/storage
VOLUME /var/www/html/public/build
VOLUME /var/www/html/storage
# 挂载主目录,也可以选择直接挂载主目录,可以把上面的几个指定的目录删掉
# VOLUME ["/var/www/html"]
# 暴露 Nginx 端口
EXPOSE 8000
# B-route bind mount 模式ENTRYPOINT 必须用完整路径build 期 symlink 被 bind mount 覆盖)
RUN chmod +x /var/www/html/source/stack/author/source/docker/run.sh
# 启动 Nginx PHP 然后阻塞
ENTRYPOINT ["/bin/bash", "/var/www/html/source/stack/author/source/docker/run.sh"]
CMD ["server"]