...
This commit is contained in:
parent
2168979196
commit
cd01c1043e
1 changed files with 66 additions and 0 deletions
|
|
@ -0,0 +1,66 @@
|
|||
|
||||
|
||||
Source:
|
||||
|
||||
[Setup CodeIgniter — Devilbox 1.0 documentation](https://devilbox.readthedocs.io/en/latest/examples/setup-codeigniter.html?highlight=CodeIgniter)
|
||||
|
||||
|
||||
Prerequisites: Have correct docker compose installed:
|
||||
```bash
|
||||
sudo apt install docker-compose-v2
|
||||
```
|
||||
|
||||
Download Devilbox
|
||||
|
||||
Remove unwanted hosts from docker-compose.yml file
|
||||
|
||||
copy env file to .env
|
||||
|
||||
Set TLD_SUFFIX=local
|
||||
|
||||
|
||||
In /etc/hosts, add 127.0.01 with application URL:
|
||||
|
||||
127.0.0.1 verleihapp.local
|
||||
|
||||
|
||||
Start docker container: sudo docker compose up -d
|
||||
|
||||
Enter Container: ./shell.sh
|
||||
|
||||
|
||||
Install CodeIgniter4 and create htdocs link:
|
||||
```bash
|
||||
mkdir myproject
|
||||
cd myproject
|
||||
composer create-project codeigniter4/appstarter myprojectapp
|
||||
ln -s myprojectapp htdocs
|
||||
```
|
||||
|
||||
.env settings
|
||||
```php
|
||||
|
||||
CI_ENVIRONMENT = development (instead of production)
|
||||
|
||||
app.baseURL = 'http://myproject.local'
|
||||
|
||||
database.default.hostname = myproject.local
|
||||
database.default.database = myproject
|
||||
database.default.username = root
|
||||
database.default.password =
|
||||
database.default.DBDriver = MySQLi
|
||||
database.default.DBPrefix =
|
||||
database.default.port = 3306
|
||||
```
|
||||
|
||||
|
||||
Access mysql from inside container
|
||||
```bash
|
||||
./shell.sh
|
||||
|
||||
mysql -h 127.0.0.1 -u root
|
||||
|
||||
CREATE DATABASE TEST_DB;
|
||||
```
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue