Fix meetable not able to read database-backend settings in docker compose

Open Beginner friendly
#218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, docker-compose, php
Domain
backend

Research direction

Start at Setting::value() in app/Setting.php, where the check for /var/www/html/.env short-circuits any value already injected as an environment variable. Read how the compose file passes env_file into the app and worker services, then pick one of the two paths the issue offers: fall back to getenv()/$_ENV in that check, or add the read-only .env volume to both services in the compose file. Done means a setting supplied only through compose environment variables shows up in the app, verified by bringing the stack up and loading a page that reads a database-backed setting.

Written by the indexing model from the issue text.

Description

With the current setup meetable isn't able to read database-backed settings because it requires /var/www/html/.env (see https://github.com/aaronpk/Meetable/blob/7d2d22ab7f85f7fef07a02ee99b9216df84c5ec4/app/Setting.php#L15). That's a problem. Settings configured just weren't applied. The solution is either to modify that check in the Setting::value() to also consider loaded env variables or load the env to the location where meetable expects them by adding the following to both the app and worker:

volumes:
      - ./.env:/var/www/html/.env:ro

That's kinda annoying though bc the compose is already injecting the .env as env variables.

Dominant language
PHP
Stars
171
Forks
14
Avg merge
1m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aaronpk/Meetable

All issues in aaronpk/Meetable

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.