Skip to content
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

Fix docker development setup after switch to puma #8396

Merged
merged 4 commits into from Sep 21, 2022

Conversation

SuperTux88
Copy link
Member

  • Replace Unicorn with Puma #8392 removed single_process_mode, which means it now requires a redis instance for development setups. This wasn't the case yet in our docker setup, so it failed to start because it didn't find redis. I added a redis container to our docker-compose setup.
  • Replace Unicorn with Puma #8392 also changed the default listen configuration for development to only listen on localhost. While this is a good default for normal development setups to not expose a port, it also broke our docker setup because the port now couldn't be forwarded outside of the docker container anymore. So I change this back to the old default when used with docker.
  • I also exposed the docker-compose command outside of the diaspora-dev script, so I'm able to run normal docker-compose commands directly without needing to manually set the correct environment variable that are required by our docker-compose.yml.

For the configurations for redis and listen, I overwrite the values set in the diaspora.toml as environment variables in the docker-compose.yml, as otherwise everybody would need to ensure that the configure the correct settings themselves in their diaspora.toml. That way it ensures that you can't break the docker-setup with a wrong setting, but can still set different settings in the diaspora.toml when running without docker.

With diaspora#8392 the `single_process_mode` was removed, which means that
development now also requires a redis.
When puma was introduced in diaspora#8392 the default listen configuration was
set to only localhost, which makes sense for most development setups,
but when run within docker, it needs to listen on all IPs so the port
can be forwarded to be accessable outside of docker.

Because the new default makes sense without docker, I overwrite the
option with a environment variable only in the docker-setup. This also
ensures that it always contains the right value needed for the
docker-setup to work, no matter what was configured outside of docker.
As the docker-compose.yml contains variables, it can't just be used with
docker-compose directly. So this manually use docker-compose commands
with all the required environment variables set.
@SuperTux88 SuperTux88 added this to the 1.0.0 milestone Sep 19, 2022
We download a static amd64 browser, so this would explode on arm64, for example.
Copy link
Member

@denschub denschub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran a few tests and it seems to work fine. Thanks for cleaning up my mess.. 🙈

docker/develop/docker-compose.yml Show resolved Hide resolved
@SuperTux88 SuperTux88 merged commit 57cdc28 into diaspora:develop Sep 21, 2022
@SuperTux88 SuperTux88 deleted the fix-docker-dev branch September 21, 2022 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants