Skip to content

Instantly share code, notes, and snippets.

@randito
Forked from juanpabloaj/Dockerfile
Created March 4, 2020 17:26
Show Gist options
  • Save randito/65bba184eb8c631646ed15b48e507d63 to your computer and use it in GitHub Desktop.
Save randito/65bba184eb8c631646ed15b48e507d63 to your computer and use it in GitHub Desktop.

Revisions

  1. @juanpabloaj juanpabloaj revised this gist Mar 3, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    # docker-compose up -d
    # docker-compose exec dev bash
    # mix phx.new new_project
    # in new_project/config/dev.exs replace hostname: "localhost" to hostname: "db",
    # cd new_project && mix ecto.create && mix phx.server
    version: '3'
    services:
    dev:
  2. @juanpabloaj juanpabloaj revised this gist Mar 3, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ USER pho

    # install the Phoenix Mix archive
    RUN mix local.hex --force && \
    mix local.rebar --force && \
    mix archive.install hex phx_new --force

    ENV HOME /home/pho
  3. @juanpabloaj juanpabloaj revised this gist Mar 3, 2020. 2 changed files with 8 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ FROM elixir:slim
    # See https://hexdocs.pm/phoenix/installation.html#node-js-5-0-0
    RUN apt-get update -y && \
    apt-get install -y curl git && \
    curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
    curl -sL https://deb.nodesource.com/setup_13.x | bash - && \
    apt-get install -y inotify-tools nodejs

    WORKDIR /code
    @@ -14,8 +14,7 @@ RUN useradd -c 'phoenix user' -m -d /home/pho -s /bin/bash pho && \
    USER pho

    # install the Phoenix Mix archive
    RUN mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phx_new.ez && \
    mix local.hex --force \
    && mix local.rebar --force
    RUN mix local.hex --force && \
    mix archive.install hex phx_new --force

    ENV HOME /home/pho
    5 changes: 5 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    # docker-compose up -d
    # docker-compose exec dev bash
    # mix phx.new new_project
    version: '3'
    services:
    dev:
    @@ -10,6 +13,8 @@ services:
    - 4000:4000
    stdin_open: true
    tty: true
    depends_on:
    - db

    db:
    image: postgres
  4. @juanpabloaj juanpabloaj revised this gist Mar 3, 2020. 2 changed files with 4 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,4 @@ RUN mix archive.install --force https://github.com/phoenixframework/archives/raw
    mix local.hex --force \
    && mix local.rebar --force

    ENV HOME /home/pho
    ENV HOME /home/pho
    5 changes: 3 additions & 2 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -4,11 +4,12 @@ services:
    build:
    context: .
    dockerfile: Dockerfile
    privileged: true
    volumes:
    - .:/code
    ports:
    - 4000:4000
    stdin_open: true
    tty: true

    db:
    image: postgres
    @@ -17,4 +18,4 @@ services:
    POSTGRES_PASSWORD: postgres

    volumes:
    phoenix_code:
    phoenix_code:
  5. @juanpabloaj juanpabloaj revised this gist Aug 2, 2019. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,11 @@
    FROM elixir
    FROM elixir:slim

    # install Node.js (>= 8.0.0) and NPM in order to satisfy brunch.io dependencies # See https://hexdocs.pm/phoenix/installation.html#node-js-5-0-0
    RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y inotify-tools nodejs
    # install Node.js (>= 8.0.0) and NPM in order to satisfy brunch.io dependencies
    # See https://hexdocs.pm/phoenix/installation.html#node-js-5-0-0
    RUN apt-get update -y && \
    apt-get install -y curl git && \
    curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
    apt-get install -y inotify-tools nodejs

    WORKDIR /code

  6. @juanpabloaj juanpabloaj created this gist Oct 26, 2018.
    17 changes: 17 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    FROM elixir

    # install Node.js (>= 8.0.0) and NPM in order to satisfy brunch.io dependencies # See https://hexdocs.pm/phoenix/installation.html#node-js-5-0-0
    RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y inotify-tools nodejs

    WORKDIR /code

    RUN useradd -c 'phoenix user' -m -d /home/pho -s /bin/bash pho && \
    chown -R pho.pho /code
    USER pho

    # install the Phoenix Mix archive
    RUN mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phx_new.ez && \
    mix local.hex --force \
    && mix local.rebar --force

    ENV HOME /home/pho
    20 changes: 20 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    version: '3'
    services:
    dev:
    build:
    context: .
    dockerfile: Dockerfile
    privileged: true
    volumes:
    - .:/code
    ports:
    - 4000:4000

    db:
    image: postgres
    restart: always
    environment:
    POSTGRES_PASSWORD: postgres

    volumes:
    phoenix_code: