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

Add support for COLLECTION_DIRS in Docker #23

Open
grantfitzsimmons opened this issue Oct 12, 2023 · 4 comments
Open

Add support for COLLECTION_DIRS in Docker #23

grantfitzsimmons opened this issue Oct 12, 2023 · 4 comments
Assignees

Comments

@grantfitzsimmons
Copy link
Member

Source: Speciforum

I am not a developer, but from what I gather in our Dockerfile on GitHub, it does not appear that the docker-compose.yml file supports setting up COLLECTION_DIRS at this time. This may be possible with some modification on our end.

See these lines in the Dockerfile:

RUN echo \
"import os" \
"\nSERVER = 'paste'" \
"\nSERVER_NAME = os.environ['SERVER_NAME']" \
"\nSERVER_PORT = int(os.getenv('SERVER_PORT', 8080))" \
"\nKEY = os.environ['ATTACHMENT_KEY']" \
"\nDEBUG = os.getenv('DEBUG_MODE', 'false').lower() == 'true'" \
>> settings.py

While the SERVER_NAME, SERVER_PORT, ATTACHMENT_KEY, and DEBUG_MODE environmental variables are entered, there is no support in our current docker deployment method for the user to submit the collection directories through the compose file.

The RUN command could likely be modified to passthrough the you are setting in the compose file, but it is currently structured as it needs to be stored in the settings.py file rather than the environmental variable format the docker-compose.yml and Dockerfile are set up to expect.

Requested By: Fedor at NHMD

@grantfitzsimmons
Copy link
Member Author

@specifysoftware
Copy link

This issue has been mentioned on Specify Community Forum. There might be relevant details there:

https://discourse.specifysoftware.org/t/specify7-in-docker-keeps-on-failing-on-port-8080/1361/12

@maxpatiiuk
Copy link
Member

I remember that Ben was hesitant to add complex props (like arrays and dictionaries) as env variables.
Instead, it might be better to provide those as a mounted python config file

@realVinayak
Copy link

I don't know if we should support very complicated props like that even in the first place, given that docker allows mounting files. So, if someone wants, they can just mount an entire settings.py file. Given that the workaround is pretty simple, and doesn't even require a separate docker image, I don't think it is worth the dev time.

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

No branches or pull requests

5 participants