morita-it-lab / docker-centos-cscart

1 stars 0 forks source link

docker-compose returned -1 #3

Open MaherJendoubi opened 8 years ago

MaherJendoubi commented 8 years ago

λ docker-compose up Creating network "work_default" with the default driver Pulling db (mariadb:latest)... latest: Pulling from library/mariadb 5c90d4a2d1a8: Pull complete 89e2627e9201: Pull complete 76f6983b0fe0: Pull complete 653577605512: Pull complete b72ef6e4e052: Pull complete c6f30e5d6b91: Pull complete e49ec6c374c5: Pull complete 814cc0bd9ff6: Pull complete 7e0ca5531f97: Pull complete e63385a4e4cd: Pull complete 29959761c95f: Pull complete 8249d226685d: Pull complete Digest: sha256:8f880226fb713d1ef3c320743a37dd2ed156cae07a6b0d0b8f32c247eaa06838 Status: Downloaded newer image for mariadb:latest Creating my-cscart-mariadb Creating my-cscart

ERROR: for cscart Container command '/start.sh' not found or does not exist. Traceback (most recent call last): File "", line 3, in File "compose\cli\main.py", line 63, in main AttributeError: 'ProjectError' object has no attribute 'msg' docker-compose returned -1

MaherJendoubi commented 8 years ago

@morita-it-lab I have a windows 7 machine, I opened a cmd console and I did docker-compose up then I get the error above.

morita-it-lab commented 8 years ago

Why Dockerfile and docker-compose.yml are not in the same folder?

To organize related files are many, so placed in different folder. set path to the build in docker-compose.yml

exec command.

Please try it.

If use Github files.

  1. Download this repository file zip.
  2. Deployment anywhere under the user directory.
  3. Go to the this directory in the DockerToolbox bash (?).
  4. exec docker-compose up or docker-compose up -d

If use Docker Hub Image.

exec this docker-compose.yml.

version: '2'
services:
    cscart:
        container_name: my-cscart
        # build: ./dockerfiles/centos7-cscart-php56
        image: reneice/docker-centos-cscart
        environment:
            SERVER_NAME: www.example.com:80
            STDOUT_ERROR_LOG: "TRUE"
            STDOUT_CUSTOM_LOG: "FALSE"
        ports:
            - 8101:80
        volumes:
            - ./docroot:/var/www/html
        links:
            - db:db
        tty: true
    db:
        container_name: my-cscart-mariadb
        image: mariadb
        ports:
            - 3306:3306
        volumes:

            # I used to because of mysqldump or exec sql files.
            # If do not use please delete.
            - ./mariadb/other_data:/other_data

            # If Mac of Windows is Permission Error occurs.
            # Sorry. I still do not know the solution.
            # - ./mariadb/database:/var/lib/mysql

        environment:
            MYSQL_ROOT_PASSWORD: cscart
            MYSQL_PASSWORD: cscart
            MYSQL_USER: cscart
            MYSQL_DB: cscart
MaherJendoubi commented 8 years ago

I did it and I get :

λ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d7f44ec648ac dockercentoscscartmaster_cscart "/start.sh" 2 minutes ago Up 46 seconds 443/tcp, 0.0.0.0:8101->80/tcp my-cscart 4bde0cbad92f mariadb "docker-entrypoint.sh" 2 minutes ago Up 46 seconds 0.0.0.0:3306->3306/tcp my-cscart-mariadb

MaherJendoubi commented 8 years ago

@morita-it-lab how to run cscart website now?

morita-it-lab commented 8 years ago

It okay.

Folder of docroot has been created. Please deploy CS-Cart zip to this folder.

MaherJendoubi commented 8 years ago

@morita-it-lab docroot hasn't been created so I created manually where I deploy the extracted CS-Cart zip but in vain. I can't acces to the web site!!!

morita-it-lab commented 8 years ago

Did you run in under the user directory?

I think that folder is created in the volumes setting of docker-compose.yml . however it does not create?

Maybe work well if the set full path...?

MaherJendoubi commented 8 years ago

I followed your instructions and I get :

image

MaherJendoubi commented 8 years ago

@morita-it-lab If I do docker ps -a, I get this : image

morita-it-lab commented 8 years ago

I tried in Windows7. But Sorry for the Japanese.

Download repository file.

ss1

ss2

Run docker-compose up -d

ss3

Access to http://mydockerhostip:8180 ( this http://192.168.99.100:8180 )

ss4

Check created folders.

ss5

Deploy CS-Cart.

ss6

Access to http://mydockerhostip:8180 ( this http://192.168.99.100:8180 )

ss7

MaherJendoubi commented 8 years ago

@morita-it-lab Thank you so much my friend and now I have the following issue : image

MaherJendoubi commented 8 years ago

@morita-it-lab I get the same issue when I use :

        MYSQL_ROOT_PASSWORD: cscart
        MYSQL_PASSWORD: cscart
        MYSQL_USER: cscart
        MYSQL_DB: cscart
morita-it-lab commented 8 years ago

Sorry, I was wrong that settings.

Please change to MYSQL_DATABASE from MYSQL_DB.

        environment:
            MYSQL_ROOT_PASSWORD: cscart
            MYSQL_PASSWORD: cscart
            MYSQL_USER: cscart
            MYSQL_DATABASE: cscart

If default setting :

mysql host name setting is

        links:
            - db:db
MaherJendoubi commented 8 years ago

@morita-it-lab Thanks a lot my friend! It works like a charm! May I blog about it, please?

morita-it-lab commented 8 years ago

I'm pleased with that good result. And thank you for pointing out the mistake. Blog is please feel free.

MaherJendoubi commented 8 years ago

@morita-it-lab thanks! I still have a question how to modify this image to make it working inside a D:\work path folder for instance, please?

MaherJendoubi commented 8 years ago

volumes:

I tried with such paths but in vain...

MaherJendoubi commented 8 years ago

@morita-it-lab In other words, I don't work on my user folder.

morita-it-lab commented 8 years ago

Sorry, I have no experience it... It might be setting of VirtualBox and docker-machine.