-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use docker compose for development #1894
Conversation
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.
I can't run the dev application locally because the redis-cluster-init
service keeps exiting for me, but the rest seems to be working well! I'd like to get it fully working before I approve though, will figure it out offline.
I also don't think it's necessary to switch from .envrc
to .env
at all! I managed to get it working by listing the values under the environment
key and just pulling the values from the system e.g.
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- DRUPAL_ROOT=${DRUPAL_ROOT-https://live-mbta.pantheonsite.io}
- MIX_ENV=dev
- OPEN_TRIP_PLANNER_URL=${OPEN_TRIP_PLANNER_URL-http://otp2-local.mbtace.com}
- REDIS_PORT=${REDIS_PORT}
- V3_API_KEY=${V3_API_KEY}
- V3_API_VERSION=${V3_API_VERSION}
- V3_URL=${V3_URL-https://api-dev.mbtace.com}
And I even (last night) managed to figure out how to get the changes from #1940 to be compatible - I added this call to my .envrc
, and with a tweak to the ExAws config to look for the environment variables, it all just worked ✨
# exports AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY
$(aws configure export-credentials --profile default --format env)
Yeah, we could always have manually listed every environment variable in the docker file, but then we have to maintain both. The idea was to have a single file to maintain that works whether or not you're working with Docker. If we pursue your path, adding or removing an environment variable means maintaining it in two places. Changing to |
Also, btw, you can export the AWS credentials without the
|
@anthonyshull Where would you want devs to invoke this? It doesn't appear to work in Unless more useful elsewhere, might make sense to add |
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.
Thanks for giving me more time with this. I think it'll work out. 🥳
a0a7c40
to
6b38e43
Compare
Pulling this branch will delete all of the contents of your .envrc file. That is because Docker can use a .env file to load environment variables. So, we use that instead. Before pulling this branch, copy your
.envrc
file to/tmp
. Pull this branch and then copy/tmp/.envrc
to./.env
. The only difference between the two is that .env removes theexport
from each line. Do that on the new file and it will work with Docker..env
is in.gitignore
but.envrc
no longer is so be very careful if you commit anything to this particular branch as I already accidentally committed sensitive information.Check the README and make sure it accurately depicts how to use docker compose.