Skip to content

add basic devcontainer setup#694

Draft
rababerladuseladim wants to merge 10 commits intoSuperCoopBerlin:masterfrom
rababerladuseladim:add-devcontainer
Draft

add basic devcontainer setup#694
rababerladuseladim wants to merge 10 commits intoSuperCoopBerlin:masterfrom
rababerladuseladim:add-devcontainer

Conversation

@rababerladuseladim
Copy link
Copy Markdown

@rababerladuseladim rababerladuseladim commented Oct 25, 2025

I added a dev container setup that should allow easy and reproducible development environment setup. If this is approved and merged, I can also update the setup instructions accordingly.

@rababerladuseladim
Copy link
Copy Markdown
Author

@Theophile-Madet could you review?

@crosspolar
Copy link
Copy Markdown
Contributor

crosspolar commented Oct 30, 2025

@rababerladuseladim I haven't used devcontainers yet. I'm getting an idea of it, but could you explain a bit more how to use it?

@rababerladuseladim rababerladuseladim marked this pull request as draft October 31, 2025 07:54
@rababerladuseladim
Copy link
Copy Markdown
Author

@crosspolar

problem

Running tapir locally looked quite cumbersome to me due to the system dependencies. The dev setup guidelines mention for example python 3.13 which might be different from the locally available python version on a dev machine, as well as a few system libraries that are required for the poetry install command to succeed. This might lead to cumbersome on-boarding of new devs or losing interested devs altogether.

solution

Add a devcontainer setup. This is automatically recognized by common IDEs (vscode, intellij family (e.g. pycharm), or github codespaces) and the IDE offers to set up the dev environment for you. In this PR, the docker-compose is executed and the IDE is run in the web container, which contains a mount of the local repo. All required dependencies are installed in the container and you can run make test straight away.

Does this answer your question?

p.s. additional motivation comes from not having worked with devcontainers myself and really wanting to try it.

Copy link
Copy Markdown
Collaborator

@Theophile-Madet Theophile-Madet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thanks for the pr 🙏

I tried using this with PyCharm, I think it needs adjustments. I'm guessing the problem is that the dev container uses the same compose environment as the dev server.

  1. Clone the repo in the fresh folder, checkout this PR
  2. Open the folder in the IDE: devcontainer gets suggested, docker compose gets started and the python packages from the inside the container get used by the IDE, that's great. I tried this from Windows where many packages are a pain to install, through the container it worked right away
  3. The docker containers are running but the command of the web container has been overridden (here), so the web server is not available.
  4. If I run docker compose up -d, the web container gets recreated with the dev server command, so I can access the server, but the connection from the IDE to the dev container gets lost.

Using the same django.Dockerfile as base is good for consistency, but I don't think the docker-compose.yml should be used.

We'll also have to check how to handle the npm and vite: the files under src are tsx / React files, the dev container probably needs to have the npm packages installed for the IDE to provide support there too. That usually happens in the vite container from vite.Dockerfile. We may have to combine the two dockerfiles to make a full dev container.

@rababerladuseladim
Copy link
Copy Markdown
Author

Hey Theo, thank you for the review. I am not fully satisfied yet, either. Test currently do not pass because I did not yet manage to file access permissions working locally and in the CI on the same image. I hope to fix that soon.

Regarding the dev environment for the vite container: my impression is that this repo contains two projects: one is the django container, the other the vite container. If that is the case, one way to separate this would be to separate that into dedicated project subfolders that each have their dedicated devcontainer. Maybe we can have a meeting / call to discuss that. What do you think?

@Theophile-Madet
Copy link
Copy Markdown
Collaborator

Hey, yes we can schedule a call, write me on slack or send me a mail, my contact is on my github profile.

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

Successfully merging this pull request may close these issues.

3 participants