dmstr / docker-yii2-app Goto Github PK
View Code? Open in Web Editor NEWDockerized application template for Yii 2.0 Framework
License: BSD 3-Clause "New" or "Revised" License
Dockerized application template for Yii 2.0 Framework
License: BSD 3-Clause "New" or "Revised" License
Hi,
I want to try this app.
But when I run it: ~ docker-compose up -d
Return:
Creating network "yii2app_default" with the default driver
ERROR: 404 page not found
I check your php stack image path "http://registry-v2.hrzg.de/dmstr/yii2-app"
same return
P.S. I'm sorry for my bad english
Dogan
hi, i have this error
$ docker-compose up -d
Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 118, in perform_command
File "compose\cli\command.py", line 37, in project_from_options
File "compose\cli\command.py", line 91, in get_project
File "compose\config\config.py", line 385, in load
File "compose\config\config.py", line 484, in load_services
File "compose\config\config.py", line 463, in build_services
File "compose\config\config.py", line 448, in build_service
File "compose\config\config.py", line 715, in process_service
File "compose\config\config.py", line 1131, in resolve_volume_paths
File "compose\config\config.py", line 1150, in resolve_volume_path
File "ntpath.py", line 311, in expanduser
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 9: ordinal not in range(128)
Failed to execute script docker-compose
$ docker --version
Docker version 17.10.0-ce, build f4ffd25
$ docker-compose --version
docker-compose version 1.16.1, build 6d1ac219
OS Windows 10
I'm stock here for 2 days now
I keep getting this error, I don't understand why! In other posts they say to not use localhost cuz it uses mysql.sock... but I dont! When I get into mycontainer I CAN ping and login into the mysql server using
mysql -h mariadb -u root -p
OR
mysql -h 172.18.0.4 -u root -p
but with Yii it doesn't work!
"name": "Exception",
"message": "SQLSTATE[HY000] [2002] No such file or directory",
"code": 2002,
"type": "PDOException",
"file": "/var/www/html/vendor/yiisoft/yii2/db/Connection.php",
"line": 660,
"stack-trace": [
"#0 /var/www/html/vendor/yiisoft/yii2/db/Connection.php(660): PDO->__construct('mysql:dbname=gt...', 'saas', '######', NULL)",
"#1 /var/www/html/vendor/yiisoft/yii2/db/Connection.php(586): yii\\db\\Connection->createPdoInstance()",
"#2 /var/www/html/common/gtb/db/TenantPdo.php(27): yii\\db\\Connection->open()",
"#3 [internal function]: gtb\\db\\TenantPdo->__construct(Object(yii\\db\\Connection), Array)",
"#4 /var/www/html/vendor/yiisoft/yii2/di/Container.php(375): ReflectionClass->newInstanceArgs(Array)",
"#5 /var/www/html/vendor/yiisoft/yii2/di/Container.php(156): yii\\di\\Container->build('gtb\\\\db\\\\TenantPd...', Array, Array)",
"#6 /var/www/html/vendor/yiisoft/yii2/di/Container.php(174): yii\\di\\Container->get('gtb\\\\db\\\\TenantPd...', Array, Array)",
"#7 /var/www/html/vendor/filsh/yii2-oauth2-server/Module.php(80): yii\\di\\Container->get('access_token')",
"#8 /var/www/html/vendor/filsh/yii2-oauth2-server/controllers/RestController.php(25): filsh\\yii2\\oauth2server\\Module->getServer()",
"#9 [internal function]: filsh\\yii2\\oauth2server\\controllers\\RestController->actionToken()",
"#10 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)",
"#11 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(157): yii\\base\\InlineAction->runWithParams(Array)",
"#12 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): yii\\base\\Controller->runAction('token', Array)",
"#13 /var/www/html/vendor/yiisoft/yii2/web/Application.php(103): yii\\base\\Module->runAction('api2/oauth/toke...', Array)",
"#14 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))",
"#15 /var/www/html/backend/web/index.php(17): yii\\base\\Application->run()",
"#16 {main}"
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=172.18.0.4;dbname=db',
'username' => 'root',
'password' => '########',
'charset' => 'utf8',
],
Host: Ubuntu
docker-compose.yml
version: '3'
services:
mycontainer:
image: nimmis/apache-php7
ports:
- "52022:22"
- "3306:3306"
container_name: mycontainer
restart: always
volumes:
- ${NGINX_FILES_PATH:-./data}/gtb:/app/gtb:rw
- ${WEB_ROOT}:/var/www/html:rw
- ${NGINX_FILES_PATH:-./data}/mycontainer.conf.d:/etc/apache2/conf-enabled:rw
- ${NGINX_FILES_PATH:-./data}/mycontainer.sites-enabled:/etc/apache2/sites-enabled:rw
mariadb:
image: mariadb
container_name: mariadb
restart: always
volumes:
- ${MARIADB_PATH}:/var/lib/mysql:rw
environment:
MYSQL_ROOT_PASSWORD: ${MARIADB_PWD}
networks:
default:
external:
name: ${NETWORK:-webproxy}
docker-compose up -d
←[31mERROR←[0m: .IOError: [Errno 22] invalid mode ('r') or filename: u'.\\"docker-compose.yml:docker-compose.dev.yml"'
Probably because the slashes or colon :
. Changes it to without slashes but same error:
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml
Tried .\\
and ./
and without and \\
Maybe it is
So i just want to connect the container to my local mysql server, but failed.
This is the error:
Database Exception – yii\db\Exception
SQLSTATE[HY000] [2002] No such file or directory
↵
Caused by: PDOException
SQLSTATE[HY000] [2002] No such file or directoryin /app/vendor/yiisoft/yii2/db/Connection.php at line 602
And this is my db config:
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=project_core', //172.24.0.3
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
],
After i change my config from localhost
to 192.168.120.1
, i got this error:
Database Exception – yii\db\Exception
SQLSTATE[HY000] [2002] Connection refused
↵
Caused by: PDOException
SQLSTATE[HY000] [2002] Connection refusedin /app/vendor/yiisoft/yii2/db/Connection.php at line 602
Could somebody tell me what is happening? Thanks
What is the license of this project ?
I would like to use it as test project setup for non-commercial purposes.
oh and also there is a bug the root folder is not define correctly in index.php it should be
$rootPath = dirname(__DIR__, 1);
After following the instruction in the README I have tried to connect to the nginx server and I have got the default nginx landing page.
A quick way to fix this is the following
If all worked as expected Yii application should be available as root page at
http://localhost:32768
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.