Skip to content

Commit

Permalink
Updates dependencies; Adds taskctl commands
Browse files Browse the repository at this point in the history
  • Loading branch information
trntv committed Feb 24, 2021
1 parent 998930e commit 19d626d
Show file tree
Hide file tree
Showing 16 changed files with 13,955 additions and 8,744 deletions.
5 changes: 0 additions & 5 deletions cept.bat

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"docker-compose run -T --rm webpacker npm run build"
],
"docker:start": [
"docker-compose up --force-recreate -d"
"docker-compose up --build -d"
],
"docker:cleanup": [
"docker-compose rm -fsv"
Expand Down
2,275 changes: 1,572 additions & 703 deletions composer.lock

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: "3.7"

services:
app:
Expand All @@ -12,14 +12,14 @@ services:
- .env

webpacker:
image: node:9-alpine
image: node:14-alpine
working_dir: /app
volumes:
- ./:/app
command: /bin/true

nginx:
image: nginx:1.12-alpine
image: nginx:1.19-alpine
ports:
- 80:80
volumes:
Expand All @@ -34,7 +34,7 @@ services:
- 1080:1080

db:
image: mysql:5.7
image: mysql:8.0
volumes:
- /var/lib/mysql
- ./docker/mysql/config.cnf:/etc/mysql/conf.d/config.cnf
Expand All @@ -45,3 +45,7 @@ services:
MYSQL_DATABASE: yii2-starter-kit
MYSQL_USER: ysk_dbu
MYSQL_PASSWORD: ysk_pass

networks:
default:
name: yii2-starter-kit_default
10 changes: 5 additions & 5 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM php:7.2-fpm
FROM php:7.4-fpm

# Install modules
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libicu-dev \
libzip-dev \
libonig-dev \
wget \
git \
--no-install-recommends

RUN docker-php-ext-install zip intl mbstring pdo_mysql exif \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd
RUN docker-php-ext-install zip intl mbstring pdo_mysql exif gd

RUN pecl install -o -f xdebug \
RUN pecl install -o -f xdebug-2.9.8 \
&& rm -rf /tmp/pear

COPY ./install-composer.sh /
Expand Down
8 changes: 4 additions & 4 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Gii is available on:
- http://yii2-starter-kit.localhost/gii
- http://backend.yii2-starter-kit.localhost/gii

## 2. How do i enable email activation?
## 2. How do I enable email activation?
Edit ``frontend/config/web.php`` and set [[frontend\modules\user\Module::shouldBeActivated]] property to ``true``

## 3. How do i access mailcatcher?
## 3. How do I access mailcatcher?
In docker installation mailcatcher is running on [yii2-starter-kit.localhost:1080](yii2-starter-kit.localhost:1080)

## 4. How do i open application cli when run application in docker?
## 4. How do I open application cli when run application in docker?
Run this command in project directory:
```
docker-compose exec app console <command> [arguments]
```
## 5. How do i change charset in existing database?
## 5. How do I change charset in existing database?
```
docker-compose exec app console app/alter-charset <charset> <collation>
```
62 changes: 25 additions & 37 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,51 @@
- [Configure your web server](#configure-your-web-server)

- [Docker installation](#docker-installation)
- [Vagrant installation](#vagrant-installation)
- [Single domain installtion](#single-domain-installation)
- [Demo users](#demo-users)
- [Important-notes](#important-notes)

## Before you begin
1. If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
1. If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
2. Install [NPM](https://docs.npmjs.com/getting-started/installing-node) to build frontend code
3. Install [taskctl](https://github.com/taskctl/taskctl) to run tasks

2. Install NPM or Yarn to build frontend scripts
- [NPM] (https://docs.npmjs.com/getting-started/installing-node)
- Yarn (https://yarnpkg.com/en/docs/install)
## Get source code
### Option 1: Get source code via Composer
You can install this application template with `composer` using the following command:

```
composer create-project yii2-starter-kit/yii2-starter-kit myproject.com
```

### Get source code
#### Download sources
### Option 2: Download sources
https://github.com/yii2-starter-kit/yii2-starter-kit/archive/master.zip

#### Or clone repository manually
```
git clone https://github.com/yii2-starter-kit/yii2-starter-kit.git
```
#### Install composer dependencies

## Install dependencies
```
composer install
taskctl install
```

### Get source code via Composer
You can install this application template with `composer` using the following command:

or
```
composer create-project yii2-starter-kit/yii2-starter-kit myproject.com
composer install
npm install
```

## Docker installation
1. Install [docker](https://docs.docker.com/engine/installation/), [docker-compose](https://docs.docker.com/compose/install/) and [composer](https://getcomposer.org/) to your system
2. Run ``composer run-script docker:build``
2. Run ``taskctl start`` or ``composer run-script docker:build``
3. That's all - your application is accessible on [http://yii2-starter-kit.localhost](http://yii2-starter-kit.localhost)

* - docker host IP address may vary on Windows and MacOS systems

*PS* Also you can use bash inside application container. To do so run `docker-compose exec app bash`

### Docker FAQ
1. How do i run yii console commands from outside a container?
1. How do I run yii console commands from outside a container?

``docker-compose exec app console/yii help``

Expand All @@ -72,7 +73,8 @@ Required PHP extensions:
- com_dotnet (for Windows)

### Setup application
1. Copy `.env.dist` to `.env` in the project root.
1. Run ``taskctl install``
1. Run ``taskctl build:env``
2. Adjust settings in `.env` file
- Set debug mode and your current environment
```
Expand All @@ -93,32 +95,18 @@ Required PHP extensions:
STORAGE_HOST_INFP = http://storage.yii2-starter-kit.localhost
```

3. Run in command line
3. Run
```taskctl local:build```
or
```
php console/yii app/setup
npm install
npm run build
```

### Configure your web server
- Copy `docker/vhost.conf` to your nginx config directory
- Change it to fit your environment

## Vagrant installation
If you want, you can use bundled Vagrant instead of installing app to your local machine.

1. Install [Vagrant](https://www.vagrantup.com/)
2. Copy files from `docs/vagrant-files` to application root
3. Copy `./vagrant/vagrant.yml.dist` to `./vagrant/vagrant.yml`
4. Create GitHub [personal API token](https://github.com/blog/1509-personal-api-tokens)
5. Edit values as desired including adding the GitHub personal API token to `./vagrant/vagrant.yml`
6. Run:
```
vagrant plugin install vagrant-hostmanager
vagrant up
```
That`s all. After provision application will be accessible on http://yii2-starter-kit.localhost

## Demo data

## Add Random Articles Data
Expand Down
5 changes: 4 additions & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Testing

## Automated

```bash
taskctl docker:tests
```
or
```
composer run-script docker:tests
```
Expand Down
72 changes: 0 additions & 72 deletions docs/vagrant-files/Vagrantfile

This file was deleted.

2 changes: 0 additions & 2 deletions docs/vagrant-files/vagrant/.gitignore

This file was deleted.

Loading

0 comments on commit 19d626d

Please sign in to comment.