gathering / wannabe

Event-system for TG - wannabe.gathering.org
GNU General Public License v3.0
12 stars 7 forks source link

Add docker compose setup #30

Closed niccofyren closed 4 years ago

niccofyren commented 4 years ago

Continues work a functional docker development setup, and starts laying groundwork for something that could work across development and production environments. Lot's of work still left todo, but should make it considerably easier to get local development up and running.

Also adds myself to the author file 😉

Relates to: https://github.com/gathering/wannabe/issues/6 Semi-relates to: https://github.com/gathering/wannabe/issues/12

simenandre commented 4 years ago

Is this still WIP?

niccofyren commented 4 years ago

Nope, just a plain old PR 😉

niccofyren commented 4 years ago

Suggested test steps for anybody feeling like reviewing this:

  1. Make sure you have a newer docker runtime install available locally
  2. Follow readme docker instructions ending in docker-compose up
  3. Go to http://localhost:4000 and use dev credentials from readme
  4. A basic dev instance of the site should be available allowing normal functionality
  5. Run docker-compose exec app /bin/bash while app is running in another terminal cake event command (and migration commands) should work as expected

Edit: Updated instructions

niccofyren commented 4 years ago

Did a few commits to keep it "up to date" while pending for review.

niccofyren commented 4 years ago

Sounds like your missing the example config files, see the readme for setup instructions 😅

Maybe we want to make these kind of config tweaks default for dev setup. Originally didn't include them since they don't make sense in a prod environment, but might make the development experience a bit smoother.

If experimenting without a dev context we might also want to make sure non-volume setup works as expected.

Atriusftw commented 4 years ago

My bad then. Thought the instance was configured in the docker image. (I just followed your steps in the previous post :))

-- Edit --

To some actual review: After setting up the configuration files, the instance starts as expected, though running cake event produces the following warning, which prevents the Plugin from running:

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/wannabe/lib/Cake/Cache/CacheEngine.php on line 60

Should we either default the timezone i our php.ini or add some instructions to update this in the docker container?

niccofyren commented 4 years ago

Most likely the app/Config/core.php file was missing, since that is where CakePHP timezone is configured by default. Fixed some issues with the documentation to rectify that, and added a default for automatically creating/copying missing config files if they are missing (but only if using dev environment)

Atriusftw commented 4 years ago

Most likely the app/Config/core.php file was missing, since that is where CakePHP timezone is configured by default. Fixed some issues with the documentation to rectify that, and added a default for automatically creating/copying missing config files if they are missing (but only if using dev environment)

Good changes. Two things when trying to run the app now:

  1. It seems that the app doesn't have permissions to automatically create the sessions folder under app/tmp/.
  2. After creating the sessions folder manually, the following is thrown:
    Error: Fatal Error (1): Call to a member function findByUsername() on null in [/var/www/html/wannabe/app/Controller/Component/AuthComponent.php, line 111]

To clarify; this is with the default docker setup (PHP 5.6)

-- Update --

The first issue was simply an error in my testing, as i had a old build. Rebuilt the image and the folders were successfully created. The second issue is fixed by another PR (#34).

I'll go ahead and merge this PR as this docker setups looks good now. Small fixes can be added later. Thanks a lot for the great effort @niccofyren 👏