Running composer install in docker container

一曲冷凌霜 提交于 2019-12-05 19:49:33

RUN ... lines are run when the image is being built. Volumes are attached to the container. You have at least two options here:

  • use COPY command to, well, copy your app code to the image so that all commands after that command will have access to it. (Do not push the image to any public Docker repo as it will contain your source that you probably don't want to leak)
  • install composer dependencies with command run on your container (CMD or ENTRYPOINT in Dockerfile or command option in docker-compose)

You are mounting your local volume over your build directory so anything you built in '/var/www/website' will be mounted over by your local volume when the container runs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!