Closed lichnow closed 5 years ago
这个涉及到代码放到哪里的问题,你可以把代码放到宿主机上(挂载到容器中),也可以打入到镜像中,直接启动容器。
.env
文件主要控制 PHP 版本?后来更新过程中可能去掉了,我明天再更新一下。
test.Dockerfile 这个主要是在容器中对 PHP 项目进行测试 (使用 PHPUnit)
文档需要更新,我明天再修改一下。
1. 这个涉及到代码放到哪里的问题,你可以把代码放到宿主机上(挂载到容器中),也可以打入到镜像中,直接启动容器。 2. `.env` 文件主要控制 PHP 版本?后来更新过程中可能去掉了,我明天再更新一下。 3. test.Dockerfile 这个主要是在容器中对 PHP 项目进行测试 (使用 PHPUnit) 文档需要更新,我明天再修改一下。
@khs1994 好的,期待。。。
@khs1994 好的,期待。。。
[php-demo](https://github.com/khs1994-docker/php-demo)中有如下文档 ### 12. 测试构建 PHP 及 NGINX 镜像 > 将 PHP 项目打入镜像,镜像中严禁包含配置文件 自行修改 .env docker-compose.yml 文件,保留所需的 PHP 版本,其他的注释 `$ docker-compose build` #### 问题一 这一步的作用是什么?我的本地和服务器环境也装了lnmp-docker,提交过去自动部署就可以了,这个打入镜像具体用来干什么的呢?是不是给开发或生产环境没有安装lnmp-docker的用户临时运行项目用的? #### 问题二 php-demo这个项目克隆下来后并没有用于生产`.env`的`.env.example`请问环境变量文件需要自己新建的吗? #### 问题三 `test`镜像配置构建需要`test.Dockerfile`,然而在这个文件在`./demo`中,需要把它复制出来,也用于构建还是直接注释`docker-compose.yml`中的`test`镜像配置呢?
php-demo中有如下文档
12. 测试构建 PHP 及 NGINX 镜像
自行修改 .env docker-compose.yml 文件,保留所需的 PHP 版本,其他的注释
$ docker-compose build
问题一
这一步的作用是什么?我的本地和服务器环境也装了lnmp-docker,提交过去自动部署就可以了,这个打入镜像具体用来干什么的呢?是不是给开发或生产环境没有安装lnmp-docker的用户临时运行项目用的?
问题二
php-demo这个项目克隆下来后并没有用于生产
.env
的.env.example
请问环境变量文件需要自己新建的吗?问题三
test
镜像配置构建需要test.Dockerfile
,然而在这个文件在./demo
中,需要把它复制出来,也用于构建还是直接注释docker-compose.yml
中的test
镜像配置呢?问题四
看到
Dockerfile
中php镜像的源镜像是khs1994/php
,请问这个镜像在哪里的?是你提交到dockerhub中的源镜像吗?我可以获得这个镜像源代码改成自己镜像吗?又或者这个镜像的源代码Dockerfile
就是lnmp-docker
包里面PHP镜像的Dockerfile.example
直接可以拿过来用的?