laravel demo
Go to file
2020-04-27 04:05:15 +02:00
app added project files 2020-04-27 04:05:15 +02:00
bootstrap added project files 2020-04-27 04:05:15 +02:00
config added project files 2020-04-27 04:05:15 +02:00
database added project files 2020-04-27 04:05:15 +02:00
public added project files 2020-04-27 04:05:15 +02:00
resources added project files 2020-04-27 04:05:15 +02:00
routes added project files 2020-04-27 04:05:15 +02:00
storage added project files 2020-04-27 04:05:15 +02:00
tests added project files 2020-04-27 04:05:15 +02:00
.editorconfig added project files 2020-04-27 04:05:15 +02:00
.env.example added project files 2020-04-27 04:05:15 +02:00
.gitattributes added project files 2020-04-27 04:05:15 +02:00
.gitignore added project files 2020-04-27 04:05:15 +02:00
.styleci.yml added project files 2020-04-27 04:05:15 +02:00
artisan added project files 2020-04-27 04:05:15 +02:00
composer.json added project files 2020-04-27 04:05:15 +02:00
composer.lock added project files 2020-04-27 04:05:15 +02:00
docker-compose.yml added project files 2020-04-27 04:05:15 +02:00
package.json added project files 2020-04-27 04:05:15 +02:00
phpunit.xml added project files 2020-04-27 04:05:15 +02:00
README.md updated README.md quite a bit 2020-04-27 04:03:24 +02:00
server.php added project files 2020-04-27 04:05:15 +02:00
webpack.mix.js added project files 2020-04-27 04:05:15 +02:00

tew-0x04

just an ultrasimple laravel mvc demo for tew classes

commands

run commands directly in the container (which is named laravel) using docker-compose exec

create a new controller

$ docker-compose exec laravel php artisan make:controller CarsController --invokable

create a migration

$ docker-compose exec laravel php artisan make:migration create_cars_table

perform predefined migrations

$ docker-compose exec laravel php artisan migrate

first setup

docker

running on fedora 32 via moby-engine

# dnf install moby-engine moby-engine-vim moby-engine-zsh-completion
# systemctl enable --now docker

enable backward compatibility for Cgroups using systemd.unified_cgroup_hierarchy=0 kernel arg (reboot implied), otherwise docker won't function correctly

make sure your user is in the docker group to be able to use docker/docker-compose
commands without sudo

run the following and log out/back in to apply the change

$ sudo groupadd docker
$ sudo usermod -aG docker $USER

why to use docker

  • the development environment setup process is greatly simplified thanks to using a docker-compose magic

  • can use mere docker-compose up to start up the container bundle

the docker-compose.yml file is largely based on the bitnami one, it was appropriated, though, to play better with fedora

selinux

after some hours of despair and a fair amount of selinux sorcery I was finally able to connect to the database (YMMV), you may need to push docker to the permissive zone

firewall

try enabling docker0 (docker networking interface) in the firewall first, running as root

# firewall-cmd --permanent --zone=trusted --change-interface=docker0

followed by

# firewall-cmd --reload

and restart docker with

# systemctl restart docker

Note: restarting docker will stop any running containers

if the above still doesn't allow you to connect to the database, also allow the docker's bridge interface in the firewall in a similar manner