Setting Docker for laravel app I got errors in "compose/cli/main.py"

Posted 1 month ago by mstdmstd

Hello! In my kubunru 18.04 I try to run docker for my laravel application

$ docker --version 
Docker version 17.12.1-ce, build 7390fc6

I have 3 files: .env :

# PATHS

DB_PATH_HOST=./databases

APP_PATH_HOST=./votes

APP_PTH_CONTAINER=/var/www/html/

docker-compose.yml :

version: '3'

services:

    web:
        build: ./web/Dockerfile.yml
        environment:
            - APACHE_RUN_USER=www-data
        volumes:
            - ${DB_PATH_HOST}:${APP_PTH_CONTAINER}
        ports:
            - 8080:80
        working_dir: ${APP_PTH_CONTAINER}
        
        

    db:
        image: mysql
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment: 
            MYSQL_ROOT_PASSWORD: 1
        volumes:
            - ${DB_PATH_HOST}:/var/lib/mysql

    adminer:
        image: adminer
        restart: always
        ports:
            - 8080:8080
            
            
    composer:
        image: composer:1.6
        volumes:
            - ${DB_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install        

/web/Dockerfile.yml :

FROM php:7.2-apache

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

Compiling, I have error:

[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker-compose up --build
Building web
Traceback (most recent call last):
  File "bin/docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 127, in perform_command
  File "compose/cli/main.py", line 1052, in up
  File "compose/cli/main.py", line 1048, in up
  File "compose/project.py", line 466, in up
  File "compose/service.py", line 329, in ensure_image_exists
  File "compose/service.py", line 1047, in build
  File "site-packages/docker/api/build.py", line 142, in build
TypeError: You must specify a directory to build in path
[6769] Failed to execute script docker-compose

I know that *.py that is python language files, but I do not use python language or work with it.

How to fix it ?

Thanks!

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.