Zum Hauptinhalt springen

Docker Dev Environment

gefahr

The provided docker configuration should not be used in production environments!

Installation on your local machine

info

If you add 127.0.0.1 foodcoopshop.test to your hosts file, you can use http://foodcoopshop.test:8001. Do not forget to change App.fullBaseUrl to http://foodcoopshop.test:8001.

Installation on Ona (formerly Gitpod)

Open in Ona

  • When all containers are up and running (takes between 1 and 2 minutes), open your Bash-terminal (not the Docker-terminal) and run bash ./devtools/init-dev-setup.sh
  • In your custom_config.php, change App.fullBaseUrl to your custom Ona-Domain (starting with https://8001-foodcoopsho-foodcoopsho... Be careful, the domain must not end with a slash!).

Login credentials

Unit Tests

  • docker exec -w /app fcs.php php ./vendor/bin/phpunit
  • On Github Actions / Ona the tests need around 2 to 3 min to finish.

Tools

  • Use composer: docker exec -w /app fcs.php composer install|update|outdated
  • Use npm-check-updates: docker exec -w /app/webroot fcs.php ncu
  • Use npm: docker exec -w /app/webroot fcs.php npm install
  • Execute migrations: docker exec -w /app fcs.php bash ./bin/cake migrations migrate
  • Build assets: docker exec -w /app fcs.php bash ./bin/cake asset_compress build

Tips for using Docker on Windows

  • Install Ubuntu and switch to WSL2
  • Docker Desktop: Settings / Resources / WSL Integration: Enable integration with additional distros: Enable "Ubuntu"
  • Clone the repo and start docker from Ubuntu (1.000 times faster than if you start it in Windows)