1.6 KiB
Docker to aid local development
-
Copy
.docker/example.envto.env(in project's root directory), change its contents to reflect your user's UID and GID respectively. This will make try to force container to not create any files as root. -
Copy
.docker/example.docker-compose.override.ymltodocker-compose.override.ymlin application's root directory. You may alter the HOST port (first one, as they're defined asHOST:CONTAINER) leaving container's port as80. -
Run
docker-compose up(orstart) and wait for fetching, extracting and building process to complete (this will happen only once or every time you'd like to rebuild the image) -
Open separate terminal (or not, if you used
docker-compose startbefore) and install project's dependencies like this:$ .docker/composer.sh install -
Visit
http://localhost(orhttp://localhost:8080if you have alteredHOST's port to8080in step 2) to see Grocy ready for your hacking. -
Every time you need Composer for something use:
$ .docker/composer.sh [require|update|etc] [other arguments] -
You may also use PHP the same way:
$ .docker/php.sh -v
Enjoy!
BONUS
Would you like to see what happens to the app when launched on PHP 7.4 or 8.1? Edit .docker/apache-php/Dockerfile and
change image tag in the first line from php:8.0-apache to php:7.4-apache or php:8.1-apache. Then make
docker-compose rebuild the container for you:
$ docker-compose build
And voila! After docker-compose up (or start) check what works and what breaks!