Skip to content

Commit

Permalink
add info to readme, chg docker-php, fix urls
Browse files Browse the repository at this point in the history
  • Loading branch information
akiraz2 committed Jan 22, 2021
1 parent 9be11da commit 865fb59
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ After installation run `init`
## Docker
Install yii2-app using [Docker](https://www.docker.com):

0. copy `.env-dist` to `.env`, configure if needed
1. run command to create project
0. run command to create project
```
docker run --rm --interactive --tty \
--volume $PWD:/app \
--volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
composer create-project --prefer-dist akiraz2/yii2-app my-site
```
2. copy `/mysql/docker-entrypoint-initdb.d/createdb.sql.example` to `createdb.sql` if you have ready DB
3. `docker-compose build`
1. copy `.env-dist` to `.env`, configure if needed
2. copy `/mysql/docker-entrypoint-initdb.d/createdb.sql.example` to `createdb.sql` if you have ready DB (so dont run migrations)
3. `docker-compose build` (you can configure Docker PHP in /php/Dockerfile-debian before building, for example, add mongodb)
4. `docker-compose up -d`
5. `docker-compose exec php bash`, in terminal run `php init`, then run other migrations (see next)
6. open localhost:8100 to test (backend on localhost:8200)
5. `docker-compose exec php bash`, in terminal run `composer install`, then `php init`, then run other migrations (see next)
6. open [http://localhost:8100](http://localhost:8100) to test frontend (backend is on [http://localhost:8200](localhost:8200))

Access to Console App: `docker-compose exec php bash` and `php yii mycommand/action`

Expand All @@ -77,9 +77,14 @@ php yii migrate --migrationPath=@yii/log/migrations/
php yii migrate --migrationPath=vendor/ignatenkovnikita/yii2-queuemanager/migrations/
php yii migrate/up
```

### Default User Credentials
login: `adminus`
password: `adminus`

### Web server config

For newbies, I will recommend to read these instructions [yiisoft/yii2-app-advanced/start-installation.md](https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/start-installation.md) (apache, nginx, etc\hosts
For newbies, I will recommend reading these instructions [yiisoft/yii2-app-advanced/start-installation.md](https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/start-installation.md) (apache, nginx, etc\hosts

## Development

Expand Down
6 changes: 3 additions & 3 deletions frontend/views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
['label' => 'Contact', 'url' => ['/site/contact']],
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
$menuItems[] = ['label' => 'Signup', 'url' => ['/user/register']];
$menuItems[] = ['label' => 'Login', 'url' => ['/user/login']];
} else {
$menuItems[] = '<li>'
. Html::beginForm(['/site/logout'], 'post')
. Html::beginForm(['/user/logout'], 'post')
. Html::submitButton(
'Logout (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-link logout']
Expand Down
9 changes: 5 additions & 4 deletions php/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN apt-get update && \
default-mysql-client \
openssh-client \
nano \
mc \
unzip \
libcurl4-openssl-dev \
libssl-dev \
Expand Down Expand Up @@ -60,11 +61,11 @@ RUN docker-php-ext-configure gd \
# Install PECL extensions
# see http://stackoverflow.com/a/8154466/291573) for usage of `printf`
RUN printf "\n" | pecl install \
imagick \
mongodb && \
imagick && \
#mongodb && \
docker-php-ext-enable \
imagick \
mongodb
imagick
#mongodb

# Check if Xdebug extension need to be compiled
RUN cd /tmp && \
Expand Down

0 comments on commit 865fb59

Please sign in to comment.