doucuo4413 2018-10-22 20:46
浏览 492

docker-compose - Composer在/ var / www / html中找不到composer.json文件

Trying to make docker container for my project and after using docker-compose up --build command I get this error: Composer could not find a composer.json file in /var/www/html.

My Dockerfile:

FROM php:7.2-apache

    RUN docker-php-ext-install \
        pdo_mysql \
        && a2enmod \
        rewrite

.env file

#PATHS

DB_PATH_HOST=./databases

APP_PATH_HOST=./wedding-planner

APP_PATH_CONTAINER=/var/www/html

part of docker-compose.yml

    version: '3'

    services:

        web:
            build: ./web
            environment:
                - APACHE_RUN_USER=www-data
[...]
        composer:
            image: composer:1.6
            volumes:
                - ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
            working_dir: ${APP_PATH_CONTAINER}
            command: composer install

Where should I put composer.json to make it work?

  • 写回答

1条回答 默认 最新

  • doutu2017 2018-10-22 21:26
    关注

    I don't think your docker-compose.yml file is replacing the variables properly.

    You can try something like this to export the variables for replacement:

    set -a
    . .env
    set +a
    docker-compose up -d --build
    
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)