Coder Social home page Coder Social logo

eproxus / docker-elixir Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azukiapp/docker-elixir

0.0 2.0 0.0 104 KB

Elixir Dockerfile for trusted automated Docker builds.

Home Page: http://images.azk.io/#/elixir

License: Apache License 2.0

Makefile 100.00%

docker-elixir's Introduction

Base docker image to run Elixir applications in azk

Versions (tags)

- [`latest`, `1`, `1.0`, `1.0.3`](https://github.com/azukiapp/docker-elixir/blob/master/1.0/Dockerfile)

Image content:

  • Ubuntu 14.04
  • Git
  • VIM

Database:

  • Erlang
  • Elixir

Usage with azk

Example of using this image with azk:

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
 
// Adds the systems that shape your system
systems({
  "elixir": {
    // Dependent systems
    depends: [], // postgres, mysql, mongodb ...
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/elixir"},
    // Steps to execute before running instances
    provision: [
      // "mix local.hex --force", // update mix
      "mix do deps.get, compile"
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    command: "mix run --no-halt",
    wait: {"retry": 20, "timeout": 1000},
    mounts: {
      "/azk/#{manifest.dir}"                : sync("."),
      // Elixir
      "/root/.hex"                          : path(env.HOME + '/.hex'),
      "/azk/#{manifest.dir}/deps"           : persistent("#{manifest.dir}/deps"),
      "/azk/#{manifest.dir}/_build"         : persistent("#{manifest.dir}/_build"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      http: "4000",
    },
    envs: {
      // set instances variables
      HEX_HOME: "/azk/#{manifest.dir}/.hex/"
    },
  },
  // Or Phoenix Framework
  "phoenix": {
    // Dependent systems
    depends: [], // postgres, mysql, mongodb ...
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/elixir"},
    // Steps to execute before running instances
    provision: [
      // "mix local.hex --force", // update mix
      "npm install",
      "mix do deps.get, compile",
      "mix ecto.create",
      "mix ecto.migrate",
    ],
    workdir: '/azk/#{manifest.dir}',
    shell: "/bin/bash",
    // Phoenix Framework
    command: "mix phoenix.server --no-deps-check",
    wait: {"retry": 20, "timeout": 1000},
    mounts: {
      "/azk/#{manifest.dir}"                : sync("."),
      // Elixir
      "/root/.hex"                          : path(env.HOME + '/.hex'),
      "/azk/#{manifest.dir}/deps"           : persistent("#{manifest.dir}/deps"),
      "/azk/#{manifest.dir}/_build"         : persistent("#{manifest.dir}/_build"),
      // Phoenix
      "/azk/#{manifest.dir}/node_modules"   : persistent("#{manifest.dir}/node_modules"),
      "/azk/#{manifest.dir}/priv/static/js" : persistent("#{manifest.dir}/priv/static/js"),
      "/azk/#{manifest.dir}/priv/static/css": persistent("#{manifest.dir}/priv/static/css"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      http: "4000",
    },
    envs: {
      MIX_ENV: "dev"
    },
  },
});

Usage with docker

To create the image azukiapp/elixir, execute the following command on the elixir folder:

$ docker build -t azukiapp/elixir .

To run the image and bind to port 4000:

$ docker run -it --rm --name my-app -p 4000:4000 -v "$PWD":/myapp -w /myapp azukiapp/elixir mix run --no-halt

Logs

# with azk
$ azk logs my-app

# with docker
$ docker logs <CONTAINER_ID>

License

Azuki Dockerfiles distributed under the Apache License.

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.