Giter Club home page Giter Club logo

elramy's Introduction

elramy

Docker environment for running Elixir applications connected with RabbitMQ and MySQL

The primary goals are currently:

  • have the 3 components running and talking to each other
  • define an efficient workflow for importing, running and modifying an elixir project
  • swap in/out elixir/OTP versions to help migrating projects to the latest

MySQL

  • Connect to the running MySQL instance by connecting your client to localhost:33061
  • any modifications make are retained as they are stored in the mysqldata volume

Workflow

The basic idea is that you can plug any elixir version in and have it work with the mysql & rabbitmq components.

iex & basic mix tasks

Interactive shell

docker run -it --rm elixir:latest iex

Create a new elixir project 'app' with a supervision tree

docker run -it --rm --name=elixir \
    --network=elramy_ntwrk \
    -v $(pwd):/usr/src/app \
    -w /usr/src/app \
    elixir:latest mix new app --sup

Install Hex locally

docker run -it --rm --name=elixir \
    --network=elramy_ntwrk \
    -v $(pwd):/usr/src/app \
    -w /usr/src/app \
    elixir:latest mix new app --sup

when adding hex the related data will be stored in /root/.mix, so by adding a .mix volume, this data is retained (otherwise you'll be prompted to add hex with every compile..)

Compile

docker run -it --rm --name=elixir \
    --network=elramy_ntwrk \
    -v $(pwd)/demo:/usr/src/app \
    -w /usr/src/app \
    elixir:latest mix compile

Interact with your demo app

docker run -it --rm --name=elixir \
    --network=elramy_ntwrk \
    -v $(pwd)/demo:/usr/src/app \
    -w /usr/src/app \
    elixir:latest iex -S mix

Workflow with .develop script

basic docker-compose shortcuts (with default env variables defined)

./develop        # ps is the default command, so same as doing: docker-compose ps
./develop up -d  # up all services, deamonize
./develop stop   # stop all services

common iex/mix stuff

./develop iex        # just start iex in an elixir contained, see ELX_VERSION
./develop iex -S mix # assume an app is created in all (see docker commands above)
./develop mix test   # runs test in the app project, etc..

elramy's People

Contributors

krislamote avatar ijunaidali avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.