Open MaherJendoubi opened 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.
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
Please try it.
docker-compose up
or docker-compose up -d
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
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
@morita-it-lab how to run cscart website now?
It okay.
Folder of docroot
has been created.
Please deploy CS-Cart zip to this folder.
@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!!!
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...?
I followed your instructions and I get :
@morita-it-lab If I do docker ps -a, I get this :
I tried in Windows7. But Sorry for the Japanese.
Download repository file.
Run docker-compose up -d
Access to http://mydockerhostip:8180 ( this http://192.168.99.100:8180 )
Check created folders.
Deploy CS-Cart.
Access to http://mydockerhostip:8180 ( this http://192.168.99.100:8180 )
@morita-it-lab Thank you so much my friend and now I have the following issue :
@morita-it-lab I get the same issue when I use :
MYSQL_ROOT_PASSWORD: cscart
MYSQL_PASSWORD: cscart
MYSQL_USER: cscart
MYSQL_DB: cscart
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 :
db
cscart
cscart
cscart
mysql host name setting is
links: - db:db
@morita-it-lab Thanks a lot my friend! It works like a charm! May I blog about it, please?
I'm pleased with that good result. And thank you for pointing out the mistake. Blog is please feel free.
@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?
volumes:
I tried with such paths but in vain...
@morita-it-lab In other words, I don't work on my user folder.
Sorry, I have no experience it... It might be setting of VirtualBox and docker-machine.
λ 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