khs1994-docker / lnmp

:computer: :whale: :elephant: :dolphin: :penguin: :rocket: Start Docker LNMP(LEMP) In less than 2 minutes Powered by Docker Compose. 让 PHP 开发者快速(一键)搭建基于容器技术(Docker、Kubernetes)的开发、测试、生产(CI/CD by Drone)环境.
https://docs.lnmp.khs1994.com
Apache License 2.0
659 stars 133 forks source link

What is the step of building a php image in php-demo? #608

Closed lichnow closed 5 years ago

lichnow commented 5 years ago

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镜像配置呢?

问题四

看到Dockerfile中php镜像的源镜像是khs1994/php,请问这个镜像在哪里的?是你提交到dockerhub中的源镜像吗?我可以获得这个镜像源代码改成自己镜像吗?又或者这个镜像的源代码Dockerfile就是lnmp-docker包里面PHP镜像的Dockerfile.example直接可以拿过来用的?

khs1994 commented 5 years ago
  1. 这个涉及到代码放到哪里的问题,你可以把代码放到宿主机上(挂载到容器中),也可以打入到镜像中,直接启动容器。

  2. .env 文件主要控制 PHP 版本?后来更新过程中可能去掉了,我明天再更新一下。

  3. test.Dockerfile 这个主要是在容器中对 PHP 项目进行测试 (使用 PHPUnit)

文档需要更新,我明天再修改一下。

pcit-ce[bot] commented 5 years ago
Source
1. 这个涉及到代码放到哪里的问题,你可以把代码放到宿主机上(挂载到容器中),也可以打入到镜像中,直接启动容器。 2. `.env` 文件主要控制 PHP 版本?后来更新过程中可能去掉了,我明天再更新一下。 3. test.Dockerfile 这个主要是在容器中对 PHP 项目进行测试 (使用 PHPUnit) 文档需要更新,我明天再修改一下。


Translate You can put the code on the host ( mount it in the container ), you can also insert it into the mirror and start the container directly. 2.'. env' files mainly control the php version? Later in the update process may be removed, i will update again tomorrow. 3. test.dockerfile-this document needs to be updated primarily for testing php projects in containers ( using phpunit ). I'll revise it tomorrow.

Tencent AI Analytic Result :smile:

lichnow commented 5 years ago

@khs1994 好的,期待。。。

pcit-ce[bot] commented 5 years ago
Source
@khs1994 好的,期待。。。


Translate @ khs 1994 ok, look forward to it. . .

Tencent AI Analytic Result :+1:

pcit-ce[bot] commented 5 years ago
Source
[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`镜像配置呢?


Translate [ php-demo ] ( https : / github.com / khs1994-docker / php-demo ) has the following documentation # 12. test build php and nginx image > the php project is mirrored, and it is forbidden to include configuration files in the mirror.envdocker-compose.yml file. Keep the required version of php, and the other comments are' $ docker-compose build' # what is the point of this step? My local and server environment also installed lnmp-docker, submitted to the automatic deployment of the past can be, this into the mirror exactly what to do? Is it used to temporarily run a project for a user whose development or production environment does not have an lnmp-docker installed? # question # 2 php-demo this project was cloned and not used to produce '.env.example.excuse me, the environment variable file needs to be new on its own was it built? # question #' test' image configuration build requires' test.dockerfile', however in this file in'. / demo', do i need to copy it out and use it for the build as well or directly annotate the 'test' mirror configuration in 'docker-compose.yml'?

Tencent AI Analytic Result :smile: