feat: 初始化 webman docker 基础镜像构建工程

This commit is contained in:
Antigravity committed 2026-09-19 11:02:28 +08:00
commit b3b4c5d7e8
3 files changed
+63

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.DS_Store
Thumbs.db
*.log
+44
View File
@@ -0,0 +1,44 @@
# Dockerfile for Webman (MaDong Backend)
FROM php:8.2-cli-alpine
LABEL maintainer="managepro"
ENV TZ=Asia/Shanghai \
COMPOSER_ALLOW_SUPERUSER=1
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk update \
&& apk add --no-cache \
bash \
curl \
git \
tzdata \
&& cp /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo "${TZ}" > /etc/timezone
# 使用 install-php-extensions 官方推荐的 ADD 方式(支持构建时走代理)
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# 使用国内镜像源极速下载并安装扩展
RUN install-php-extensions \
pcntl \
posix \
event \
pdo_mysql \
redis \
gd \
zip \
bcmath \
opcache \
intl
# 安装 Composer(直接从国内镜像下载 composer.phar,不需要额外拉取 composer 镜像)
RUN curl -sS https://mirrors.aliyun.com/composer/composer.phar -o /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
WORKDIR /app
EXPOSE 8500
CMD ["php", "start.php", "start"]
+16
View File
@@ -0,0 +1,16 @@
# Webman Docker 基础镜像
适用于 [Webman (Workerman)](https://www.workerman.net/doc/webman) 高性能 PHP 常驻内存框架的通用运行与开发环境。
## 特性
- 基于 `php:8.2-cli-alpine`
- 集成 Workerman 核心必需扩展:`pcntl`、`posix`、`event`
- 常用业务扩展:`pdo_mysql`、`redis`、`gd`、`zip`、`bcmath`、`opcache`、`intl`
- 内置 Composer 2.x 并默认配置阿里云镜像源加速
- 默认工作目录 `/app`,暴露端口 `8500`
## 构建方法
```bash
docker build -t webman:8.2 .
```