Docker“无效的装载路径app / symfony”必须是绝对的
我试图设置Webpack与码头运行。 我正在寻找把它放在自己的容器,建立文件,然后nginx将在其容器上提供的代码。
我docker-compose.yml
文件如下所示:
nginx: build: ./nginx/ ports: - 80:80 links: - php volumes_from: - app php: build: ./php/ expose: - 9000 links: - mysql volumes_from: - app app: image: php:7.0-fpm volumes: - ./app/symfony:/var/www/html command: "true" web: build: ./webpack volumes_from: - app mysql: image: mysql:latest volumes_from: - data environment: MYSQL_ROOT_PASSWORD: secret MYSQL_DATABASE: project MYSQL_USER: project MYSQL_PASSWORD: project data: image: mysql:latest volumes: - /var/lib/mysql command: "true"
我的代码存储在app/symfony
目录中。 webpack容器的Dockerfile目前是:
FROM node:wheezy WORKDIR /app RUN apt-get update RUN apt-get install curl -y RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install nodejs -y RUN npm install webpack -g RUN npm install CMD webpack --watch --watch-polling
我收到错误:
ERROR: for web Cannot create container for service web: invalid bind mount spec "a60f89607640b36a468b471378a6b7079dfa5890db994a1228e7809b93b8b709:app/symfony:rw": invalid volume specification: 'a60f89607640b36a468b471378a6b7079dfa5890db994a1228e7809b93b8b709:app/symfony:rw': invalid mount config for type "volume": invalid mount path: 'app/symfony' mount path must be absolute ERROR: Encountered errors while bringing up the project.
我想要webpack把app / symfony中的代码,并建立任何资产,然后nginx容器将服务于这些。