基于ubuntu 镜像一键安装LNMP1.5. (lnmp.org)
dockerfile: (已经先安装好lnmp1.5后才进行的步骤
FROM lnmp
RUN apt-get update
&& apt-get -y install supervisor
COPY supervisord.conf /etc/supervisord.conf
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT.sh: #!/bin/bash /etc/init.d/ssh restart lnmp start /usr/bin/supervisord -c /etc/supervisord.conf
supervisord.conf: [supervisord] nodaemon=true
user=root autorestart=true priority=200
docker run -d
--name web
-p 80:80
-v /root/dk/web/lnmp:/usr/local
-v /root/dk/web/home:/home
cowade/lnmp bin/bash
如果需要挂载LNMP的安装目录以及网站目录到宿主机,要先运行一个容器,用docker cp命令把容器里的/usr/local/ 以及Home文件夹拷贝到宿主机,然后把容器删掉再重新运行一个容器把拷贝出来的文件夹对应回去才行。
Content type
Image
Digest
Size
473.8 MB
Last updated
almost 8 years ago
docker pull cowade/lnmp