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

RFC: Publish dev container? #1982

Open
czosel opened this issue Apr 10, 2023 · 2 comments
Open

RFC: Publish dev container? #1982

czosel opened this issue Apr 10, 2023 · 2 comments
Assignees

Comments

@czosel
Copy link
Contributor

czosel commented Apr 10, 2023

When following the Caluma getting started guide, the caluma container currently doesn't start because it is configured with ENV=development but is missing dev dependencies:

ModuleNotFoundError: No module named 'django_extensions'

The simplest workaround I came up with is to add a local Dockerfile containing only one line:

FROM ghcr.io/projectcaluma/caluma:latest

and adding a build instruction to the compose file:

    build:
      context: .

It would be nice to remove this friction from the first contact with Caluma - how about we publish a dev container, which contains all the dev dependencies?

@winged
Copy link
Contributor

winged commented Apr 12, 2023

I think the published image is OK as a "production" image. When you're developing, you should build the image yourself, in my opinion. Having a separate "dev" image published makes things much more complicated.

There are a few potential issues with our current docs however:

  • We reference our development docker-compose.yml file and present it as an example starting point. One (better?) option would be to provide an explicit development example, as well as a possible production example instead
  • The docs suggest adding ENV=development to the override file. This triggers the additional dependencies. We could solve this by also suggesting the build: bit to be added there as well, which is exactly what "our" override file does.
  • Alternatively, we could implement a ENV=demo mode, that disables the security stuff, but doesn't require the dev dependencies.

All of the options have pros and cons. I think when you're enabling development mode, you should build the image locally. If you're just getting started, the build process can be a bit intimidating, as it will take a while depending on the user's machine.

The "demo" mode could be implemented rather easily, but adds a (small) bit of complexity to the already-complex settings file structure. Still simpler than publishing a dev image though.

@winged
Copy link
Contributor

winged commented Apr 12, 2023

Just had a look at the code. In the caluma/settings/django.py we already have a check for ImportError. When I try to replay the getting started guide, things start up just fine - just the static files for the Graphiql interface are missing because we're still starting UWSGI and not the dev server.

Could it be that you have an old docker image in your local cache? The fix is kinda new-ish - from December 2022

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

No branches or pull requests

4 participants