odan / slim4-skeleton

A Slim 4 Skeleton
https://odan.github.io/slim4-skeleton/
MIT License
447 stars 80 forks source link

Slim 4 Skeleton docker-compose missing #47

Closed thedarkknight197 closed 3 years ago

thedarkknight197 commented 3 years ago

Hi i am following your wiki on: https://odan.github.io/slim4-skeleton/setup/docker.html but after i have created my application with:

composer create-project odan/slim4-skeleton my-app

the file docker-compose.yml will not create, and i can't run my docker container.

Anyone can help me?

Thank you

odan commented 3 years ago

The docker-composer.yml file is part of the skeleton. See here: https://github.com/odan/slim4-skeleton/blob/master/docker-compose.yml

thedarkknight197 commented 3 years ago

Schermata 2021-01-07 alle 13 38 01 Cloning your repo

Trying adding docker-compose.yml and Dockerfile from your repo to my project that i have created before i have this error: Schermata 2021-01-07 alle 13 45 12

thedarkknight197 commented 3 years ago

I have update my env file with

$settings['db']['database'] = 'test'; $settings['db']['username'] = 'root'; $settings['db']['password'] = 'root'; $settings['db']['host'] = 'testslim_db_1';

Now i Recive: Schermata 2021-01-07 alle 13 55 04 Schermata 2021-01-07 alle 13 55 37

odan commented 3 years ago

autoloader.php is missing

This means the composer autoloader is missing. Just run composer update to create the vendor directory.

Notice: Undefined index index column_name in DataTableRepository.php line 220

This PHP notice is not related to the docker container. It looks like the column_name is not defined. Please try to clone the latest version of the repo.

thedarkknight197 commented 3 years ago

Mh I think that I miss to import the db. I have to do migration or you have an import mysql-dump?

thedarkknight197 commented 3 years ago

I use Laravel, to do migration I need to run:

php artisan migrate

Exist for Slim a similar running command? I only create my db without table. but it call the db: test, I don't know if is this the problem. Now I am at Home, tomorrow at work I see the project

odan commented 3 years ago

Slim is a micro-framework and provides only routing and dispatching functionality. This skeleton provides a phinx to migrate the table structure, e.g. composer migrations:migrate

thedarkknight197 commented 3 years ago

On your docker launched at /var/www/html

`composer migrations:migrate

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "migrations" namespace.
`

thedarkknight197 commented 3 years ago

if i move in resources:

`cd resources

ls

docker locale migrations seeds

composer migrations:migrate

No composer.json in current directory, do you want to use the one at /var/www/html? [Y,n]? y

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "migrations" namespace.

`

odan commented 3 years ago

All commands must be started from the project-root directory. Composer is usually only installed on the development machine but not on the production server.

For development (only) composer migrations:migrate

For production:

If Composer is not installed on the target server, the following command can be used: $ vendor/bin/phinx migrate -c config/phinx.php

Please read the documentation of this skeleton-project first.

https://odan.github.io/slim4-skeleton/database.html#update-schema