#最小的alpine Linux(10Mb)
FROM alpine:latest
#安装init
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add wget curl nload php7-cli php7-redis php7-pcntl php7-posix php7-iconv php7-pdo php7-gd php7-pdo_mysql \
&& apk add composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
WORKDIR /app
COPY / /app
RUN composer install \
&& mkdir -p /tmp/logs \
&& mkdir -p /tmp/sessions \
&& mkdir -p /tmp/views \
&& rm -rf /app/runtime \
&& ln -s /tmp /app/runtime
#暴露8787端口
EXPOSE 8787
CMD ["php","/app/start.php","start"]
在当前目录执行,最后有一个 .
别忘记复制
docker build -t webman:latest .
docker run -it -p 80:8787 webman:latest
如果缺什么拓展就apk 安装,例如
如果缺linux指令,例如
跑不起来说是没有 event 大佬怎么安装呢
我的是这样的
是不是因为我用的是 gateway
我的dockerfile仅仅针对webman http(workerman4.x)服务,如果是gatewayworker 我会再出一个的,
大佬在呀,谢谢了我坐等 ^_^
坐等大佬,谢谢
executor failed running [/bin/sh -c sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add wget curl nload php7-cli php7-redis php7-pcntl php7-posix php7-iconv php7-pdo php7-gd php7-pdo_mysql && apk add composer && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/]: exit code: 8
FROM alpine:latest
换成
FROM alpine:3.16.0