soyjeansoy
hi everyone, how can i mix deps.get when im using docker?
whenever i run docker-compose run web mix phx.new hello and press yes, it didnt get past mix deps.get
now if i go to hello dir and do docker-compose run web mix deps.get , it says cant find mix project (mix.exs)
sorry if its a desperate question, im new to docker and I tried numerous sample docker setup via github.
# Dockerfile
version: '3.2'
services:
db:
image: postgres:alpine
web:
build: .
volumes:
- type: bind
source: .
target: /app
ports:
- "4000:4000"
depends_on:
- db
# docker-compose.yml
FROM elixir:alpine
RUN apk add postgresql-client inotify-tools nodejs
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix archive.install hex phx_new --force
WORKDIR /app
EXPOSE 4000
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
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
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kynoshi
Hi soyjeansoy!
My first lucky guess is that the container you are running deps.get isn’t configured to sustain the data mix is creating/downloading. If you can put a minimal setup of your codebase/environment anywhere on github, I would be happy to have a look on it for you.
soyjeansoy
hi @kynoshi thank you for helping me out.
im using this setup. im doing as simple as I can just so I could understand every step.
kynoshi
The docker compose file you uploaded on github is a bit different than the one you put on in this thread. But that’s irrelevant to your issue anyways.
You do not have an elixir issue, rather than a simple folders confusion and/or docker learning opportunity. Setting up the phoenix project using
docker-compose run web mix phx.new helloruns well and uses/appas your current workfolder.When you try to update the elixir dependencies using
docker-compose run web mix deps.getyou are STILL working inside the/appfolder, but you want to run the command inside/app/hellowhere themix.exsis located. For a better illustration of what this means, see the screenshot below.I recommend giving
docker-compose run web /bin/sha try, to fiddle around a bit inside the container and to get a better mental model of elixir projects inside a docker container.Have fun!
soyjeansoy
oh got it thank you! yea im confused where should i run the commands
emoragaf
So coincidentally I blogged a couple of days ago about using docker and docker compose with elixir.
The idea was to setup a dev environment with docker as the only dependency needed.
I started with a project folder and all the docker stuff (docker-compose + dockerfile)
Then I did two things to try to make things simpler:
mixandiexthat wrapdocker-compose run app mix/iexcallsmix phx.new . --app my_appThe post is in spanish, so i won’t shamelessly plug it here, but I added all the code on this repo (there are numbered branches that show the steps involved)
soyjeansoy
@emoragaf thank you for helping. You added node in Dockerfile, how can we achieve the same thing with docker-compose.yml?
emoragaf
I guess that you could try to find a base image (or create one and publish it) that already has all the os dependencies that you need. And only define a docker-compose.yml
But in general I would create a Dockerfile for each project