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

Make docker volume paths configurable. #378

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

JonasGilg
Copy link
Collaborator

Description

It is now possible to specify the docker volume path via the .env file.

@JonasGilg JonasGilg self-assigned this Aug 27, 2024
@annawendler
Copy link
Contributor

annawendler commented Aug 27, 2024

You say it is possible to set the VOLUME_DIR in the .env file. This is not clear to me. Can you adapt the .env template?

Copy link

Test Results

39 tests  ±0   39 ✅ ±0   11s ⏱️ ±0s
17 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 6d38a12. ± Comparison against base commit d7dd9b8.

@JonasGilg
Copy link
Collaborator Author

You say it is possible to set the VOLUME_DIR in the .env file. This is not clear to me. Can you adapt the .env template?

Yes, I updated the .env templates. You can give a path, where docker should store all the data. It is required that the folder exists with the 3 subfolders mentioned in the comment in the .env template. It is not required anymore to create docker volumes with docker volume create!

@annawendler
Copy link
Contributor

Thank you. I created a folder with the specified three subfolders and set the VOLUME_DIR in .env.docker and backend/.env. When running "USER_ID=$(id -u) GROUP_ID=$(id -g) docker-compose -f docker-compose.dev.yml up -d" I get "KeyError: 'ContainerConfig'". Do you have an idea where this is coming from?

@JonasGilg
Copy link
Collaborator Author

Thank you. I created a folder with the specified three subfolders and set the VOLUME_DIR in .env.docker and backend/.env. When running "USER_ID=$(id -u) GROUP_ID=$(id -g) docker-compose -f docker-compose.dev.yml up -d" I get "KeyError: 'ContainerConfig'". Do you have an idea where this is coming from?

I am not quite sure. If I remember correctly we had issues with the docker-compose files in the backend folder and just used the docker-compose file in the root folder. There you should also create an .env file with the same values.

Run this in the root folder: USER_ID=$(id -u) GROUP_ID=$(id -g) docker-compose -f docker-compose.yaml up -d

@annawendler
Copy link
Contributor

I think the issue was some interference with the old volumes which I could solve. Now, when I want to run "USER_ID=$(id -u) GROUP_ID=$(id -g) docker-compose -f docker-compose.dev.yml run --rm backend python manage.py import_rki rki.zip" I get the error "django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known". I also noticed that I can't reach pgAdmin via the browser. Is there another path that needs to be adapted regarding the docker volumes? I couldn't solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants