JovaniPink
I just saw the announce of Awesome-Compose, “a Github repository with application samples” using Docker Compose.
Announcement Blog:
Awesome Compose for Sample Apps
Actual Git Repo:
Awesome-Compose
I thought it would be a great community effort if we added solid, regularly used, and popular docker compose recipes to the list.
Could you’all send me links or guides me to any examples that the community uses so we could add.
Thank you and for your support!
PS: I’m just starting off with Elixir and Phoenix and this would be super beneficial for me. ![]()
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
The obligatory hello world thread!
Who are you and where are you from? :stuck_out_tongue:
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
Is there a word for the ~> symbol used in Version strings?
Do you also just call it a Squiggle Arrow™ ?!
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 17 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Exadra37
The shadowing issue is only an issue if you run
mix deps.getandmix compilein both the host and the container, otherwise is a non issue. If you run in both than you just need to map each folder in your root project and leave out thedeps,_buildand I think theassets/node_modulesfolders.This is a completely different issue, and is nothing related with shadowing, instead it means you are missing the OS dependencies to build bccrypt in the container or if you are running mix commands in both the host and in the container, then it may cause issues, because bcrypt was compiled for a different target, but without seeing the exact error is hard to say.
To resume if you don’t run mix commands in both the container and host, shadowing is a non issue.
Docker Stack
Dockerfile
The Dockerfile now as non root user with the id
1000. Please read the comments in the Dockerfile to see if you need to customize this id for your computer.You can now build any combination of Elixir and Phoenix version:
Docker Compose
I don’t have Elixir installed in my host, therefore I cannot test this docker compose file, but if I have not missed anything it will allow you to run mix commands from the host and container without causing issues:
JackMaarek
Well this is a nice fix but I don’t think that it resolve the shadowing issues of deps folder in the container, by using volumes it will pull all the local files into the container and shadow the stuff in the container… I just tried it and I got an error while loading Bcrypt on a sign-in method for example.
Exadra37
So just remove from your Dockerfile:
Add this:
and fix your docker compose volume to:
But his is running as root, and that is not good from a security point of view.
With this changes you don’t need to rebuild your image each time you change files in the host.
Just add inotify tools to the container and host OS and change the max number of files he can watch, and you are good to go.
I use this for years without any problems.
I am working on an Elixir Docker Stack that just makes everything a breeze, but not yet ready for others to try because the base image is not yet released in Docker Hub, therefore you cannot try it in your computer.
JackMaarek
Generaly I just use my terminal not the one from the editor. For now i’m not working with docker containers on dev env as I need to restart them on each changes.
Exadra37
Just a quick question… Do you run your project code from within your editor, be it for running tests or anything else, like to open a iex session?
JackMaarek
With pleasure !
Here is the new project directory:
The Dockerfile :
The docker-compose file:
And .dockerignore:
If you have any suggestion/reviews I will love to hear them.
Thanks a lot !
Exadra37
Share your Dockerfile and docker compose so that we can try to help you, because I use Docker for all my development stuff, including to run the Android Studio editor, that’s a very complex and heavy tool, and things just works, provided you have the correct setup and Operating System
I use an Elixir Docker Stack with a lot of bash helpers that makes Elixir development a breeze and a joy, and I also run the editor from inside another docker container.
JackMaarek
Ok guys so I found that when you use volumes in docker-compose your create some side effects that could result in problems.
When you use the volume and pull everything from your project root directory you are overloading the content of the compiled stuff in your container so some dependencies won’t be “accessible” as their dependencies need to be compiled in order to work correctly.
Off course correct me if i’m wrong.
From my initial post I had a .docker folder that contains the necessary Dockerfile for my image with a setup shell script and in my project root directory I had my docker-compose file that was pulling all the project and target the project folder in my container.
Now I moved out my dockerfile in my project root directory because I canot copy files from a parent path of the context and even if it’s logic I do not really get how to keep my dockerfile in the docker folder, this is not much but I was usually using volumes in my compose files also to pull the source code even after a change. I’m also a little bit confused because this mean that at every change you need to rebuild the project, that’s a time waste.
At least you could only copy your mix.deps files and compile them but if you’re still using volumes you will override the deps and _build folder. For now I’m staying with this approach but do not hesitate to share your reviews !
The almighty @NobbZ explained very well all the side effects that this would cause and how a container should really behave: here.
Thanks a lot man !
akoutmos
I leverage Docker Compose for most of my tutorials on my blog. Below is a listing of the tech stacks, articles, and repos for each of the tutorials:
Prometheus, PostGIS and Phoenix Part 1
Article: Prometheus, PostGIS and Phoenix Part 1-Alex Koutmos | Engineering Blog
Repo: GitHub - akoutmos/elixir_monitoring_prom: Companion code for https://akoutmos.com/post/prometheus-postgis-and-phoenix/ · GitHub
Tech Stack: Elixir app, Postgres+PostGIS, Grafana, Prometheus, Postgres Exporter
Broadway, RabbitMQ, and the Rise of Elixir Part 1
Article: Broadway, RabbitMQ, and the Rise of Elixir Part 1-Alex Koutmos | Engineering Blog
Repo: GitHub - akoutmos/elixir_popularity: Companion code for https://akoutmos.com/post/broadway-rabbitmq-and-the-rise-of-elixir/ · GitHub
Tech Stack: cAdvisor, RabbitMQ, Postgres, Postgres Exporter, Grafana, Prometheus
Structured logging in Elixir using Loki
Article: Structured logging in Elixir using Loki-Alex Koutmos | Engineering Blog
Repo: GitHub - akoutmos/auto_finder: Companion code for https://akoutmos.com/post/elixir-logging-loki/ · GitHub
Tech Stack: Elixir app, Postgres, Loki, Grafana
And finally, while not Docker Compose specific, how to build Mix Releases with Docker:
Multi-stage Docker Builds and Elixir 1.9 Releases
Article: Multi-stage Docker Builds and Elixir 1.9 Releases-Alex Koutmos | Engineering Blog
Repo: GitHub - akoutmos/docker_elixir_19_release: Companion code for https://akoutmos.com/post/multipart-docker-and-elixir-1.9-releases/ · GitHub
JovaniPink
Sweet Work.