# docker-webman-static-php **Repository Path**: izqiming/docker-webman-static-php ## Basic Information - **Project Name**: docker-webman-static-php - **Description**: 基于 Alpine Linux 镜像使用静态 PHP 构建运行 webman 的容器。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-09-03 - **Last Updated**: 2024-09-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: webman, Docker ## README 基于 Alpine Linux 镜像使用静态 PHP 构建运行 webman 的容器。 ## 设置仓库地址 ```shell #!/bin/bash # Git 仓库的 URL REPO_URL="https://username:password@github.com/yourspace/repo.git" # 目标目录 TARGET_DIR="/app" # 切换到目标目录 cd "$TARGET_DIR" || exit 1 # 检查 .git 目录是否存在 if [ ! -d ".git" ]; then # 如果 .git 不存在,则执行 git clone git clone "$REPO_URL" . export COMPOSER_ALLOW_SUPERUSER=1 composer config repo.packagist composer https://mirrors.aliyun.com/composer/ composer install chmod -R 777 /app/public /app/runtime fi /usr/bin/php /app/start.php restart ``` ## 构建 ```shell docker build -t ImagesName . ``` ## 创建容器 ``` docker run --rm -it -p 8787:8787 -v /path/webman:/app ImagesName ``` ## 静态 PHP ```shell wget https://www.workerman.net/download/php/php-7.4.33-static-bin-x86_64.tar.gz ``` 静态 PHP 可以从 [workerman](https://www.workerman.net/download) 下载,也可以从 [static-php-cli](https://static-php.dev/zh)或 [Github](https://github.com/crazywhalecc/static-php-cli) 选择需要的扩展自行进行编译。