68 lines
No EOL
1.2 KiB
Markdown
68 lines
No EOL
1.2 KiB
Markdown
|
|
|
|
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/public 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;
|
|
```
|
|
|
|
|
|
|
|
https://shield.codeigniter.com/getting_started/install/ |