-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🧑💻 Update docker environment and optimise for local development #2074
Conversation
31971d4
to
3b30024
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @jeyemwey! I appreciate all these changes. I have just two questions/concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without specifying the git hash and just using the 5
version number for derhuerst/db-rest
, I can finally build/start the project on my M1/ARM Mac. Thanks!
However I'm still getting tons of errors from the seeding process:
2023-10-23 18:41:33 Seeding database
2023-10-23 18:41:33
2023-10-23 18:41:33 Dropping all tables ............................................... 4ms FAIL
2023-10-23 18:41:33
2023-10-23 18:41:33 UnexpectedValueException
2023-10-23 18:41:33
2023-10-23 18:41:33 There is no existing directory at "/usr/src/trwl/storage/logs" and it could not be created: Permission denied
2023-10-23 18:41:33
2023-10-23 18:41:33 at vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:197
2023-10-23 18:41:33 193▕ set_error_handler([$this, 'customErrorHandler']);
2023-10-23 18:41:33 194▕ $status = mkdir($dir, 0777, true);
2023-10-23 18:41:33 195▕ restore_error_handler();
2023-10-23 18:41:33 196▕ if (false === $status && !is_dir($dir) && strpos((string) $this->errorMessage, 'File exists') === false) {
2023-10-23 18:41:33 ➜ 197▕ throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and it could not be created: '.$this->errorMessage, $dir));
2023-10-23 18:41:33 198▕ }
2023-10-23 18:41:33 199▕ }
2023-10-23 18:41:33 200▕ $this->dirCreated = true;
2023-10-23 18:41:33 201▕ }
2023-10-23 18:41:33
2023-10-23 18:41:33 +10 vendor frames
2023-10-23 18:41:33
2023-10-23 18:41:33 11 app/Exceptions/Handler.php:41
2023-10-23 18:41:33 Illuminate\Foundation\Exceptions\Handler::report(Object(Illuminate\Database\QueryException))
2023-10-23 18:41:33 +3 vendor frames
2023-10-23 18:41:33
2023-10-23 18:41:33 15 artisan:37
2023-10-23 18:41:33 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
docker-compose.yml
Outdated
networks: | ||
- internal | ||
environment: | ||
- TZ=Europe/Berlin | ||
env_file: | ||
- .env.docker | ||
|
||
db-rest: | ||
# we are stuck on db-rest version 5, | ||
image: derhuerst/db-rest@sha256:c2373bf5765a2b7e952753acbd2533b747fe1a3e29bb3759db50cdf69f077618 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: derhuerst/db-rest@sha256:c2373bf5765a2b7e952753acbd2533b747fe1a3e29bb3759db50cdf69f077618 | |
image: derhuerst/db-rest:5 |
@jeyemwey Do you mind taking a look at the errors from my latest post? Any idea, why the seeding fails due to permission problems? |
I'm currently on holiday and don't have a development environment with me. Please give me another week or so until I can merge the things into In the mean time, can you try creating the subfolders on the host system? Maybe it's just a permissions thing. |
Could you take another look? The subfolders already exist on the host system |
Hi, sorry for the long wait. I have pushed 1cd3472 and 4dc0564 which address a number of issues:
I have now tested (on my M1 mac) like this: cd /tmp
git clone git@github.com:Traewelling/traewelling.git
cd traewelling
git checkout dev/jv/docker-env
vi docker-compose.yml # to activate the `SEED_DB` env
docker-compose up --build -d
# wait until the containers are ready
open "http://localhost:8081" Please check and let me know if it works for you :) |
From my side, it's good to go, but I haven't tested on anything but my Mac. |
Then I would suggest that we merging this soon if nobody puts a veto. :) |
As asked in the discord, I simplified the docker compose environment so it is more usable in local development.
This PR does a few things:
docker-compose.yml
to always use the local build and a.env.docker
I hope that traewelling and laravel newbies can work with the changes better and contribute to the project quicker.
Meta: There are a bunch of changes in a large number of files, so especially for the
README.md
and thedocker-compose.yml
it would be helpful to just read through the final result.