Has Anyone Used Dev Containers for Elixir Development?

Recently, I’ve heard people using dev containers for development. I want to give it a try—has anyone here developed an Elixir app with them? Any tips or experiences would be appreciated.

I’m working on an Elixir cluster (Phoenix + Postgres) on macOS, with Kubernetes as the deployment environment.

1 Like

I know that my co-worker is using containers for development, though I don’t know if he does it the dev-containers way.

Also I don’t know if he is active on this forum or whether he has an account.

1 Like

Personally I’d advise using something like devenv.sh instead of a dev container. Most of the advantages without the disadvantages of Docker.

Been using that for two years, a dev can switch between any project and have the exact same setup as any other dev in a matter of moments

2 Likes

They are nice for a uniform and reproducible development environment.

They are NOT great when used in github’s browser based devcontainer environment ( extremely slow, laggy ).

I see it as trading in one set of problems for another. ( easily reproducible dev envs, for docker debugging issues )

In the same sense that having a web app inside the container network is a pain, because you’ll have a layer of problems arise from the internal DNS, networking layer, volume mount issues, files missing, etc, meaning there’s more stuff to go wrong in comparison to just having the standard stuff go wrong ( service ports not open, dependencies missing )

just my opinion, nice for initial start, less nice for long term debugging, but still okay

It’s a layer of abstraction, so it doesn’t help developers with learning how to do things manually when stuff goes wrong.

It might just be how i like things, but it really bugs me when tools get in the way, and its especially true for visual studio code and dev containers, its just a layer ( hey its great if its working, but at the same time, I don’t want to spend a few hours debugging/configuring/diagnosing the tool, the plugin, the whatever, just so i can get to the work )

2 Likes

Hi! I just created a template for a Phoenix 1.8.3 project using Docker and Docker Compose, both for production deployment and for running Docker Compose in development mode.

Feel free to download it and adapt it to your needs. If you have any questions, you can send me a message — I’d be happy to help you with whatever you need :slight_smile:

1 Like

I’m wondering if the question was originally about this?

See:

I only did a quick skim of the repo you shared ( which looked promising for sure ), or maybe I misunderstood the original question.

I thought the original question was about devcontainer.json setup?

I think it’d be straight forward to vibe into your template_docker_dev repo?