我正在尝试设置docker-compose,运行php,composer和mysql堆栈。
我有以下docker-compose.yaml:
version: '3'
services:
provision:
container_name: 'docker_stack'
working_dir: /var/www/html
build:
context: .
dockerfile: Dockerfile
ports:
- '80:80'
- '443:443'
volumes:
- ./:/var/www/html
- ./.conf/:/etc/apache2/sites-enabled/
在我的Dockerfile中:
FROM php:7.2-apache
RUN a2enmod rewrite
RUN service apache2 restart
WORKDIR /var/www/html/
RUN php init --env="Development" --overwrite=All
然而,最后一个命令失败了,因为它找不到init文件,这是一个php脚本。
另外,我如何将composer附加到它?
发布于 2018-09-30 18:51:06
RUN apt-get update && \
apt-get install -y --no-install-recommends git zip
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer --version
是我在Dockerfiles中用来安装composer的。
另外,你有没有试过使用
RUN php /var/www/html/init --env="Development" --overwrite=All
https://stackoverflow.com/questions/52577143
复制相似问题