Skip to content

Instantly share code, notes, and snippets.

@patterns
Created January 28, 2019 10:44
Show Gist options
  • Save patterns/2194fa93d6f29c442907cf77d6ab84cd to your computer and use it in GitHub Desktop.
Save patterns/2194fa93d6f29c442907cf77d6ab84cd to your computer and use it in GitHub Desktop.

Revisions

  1. patterns created this gist Jan 28, 2019.
    30 changes: 30 additions & 0 deletions Dockerfile.GRPC
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    FROM elixir:1.8

    ARG ZIPPROTOC=https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
    ARG TGZGOLANG=https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz

    ENV PATH=/root/.mix/escripts:/root/go/bin:/usr/local/go/bin:/usr/local/protoc/bin:$PATH

    # We need to add golang since base image is now elixir
    RUN curl -o golang.tar.gz -L $TGZGOLANG ; \
    tar -C /usr/local -xzf golang.tar.gz ; \
    rm golang.tar.gz ; \
    go get -u google.golang.org/grpc ; \
    go get -u github.com/golang/protobuf/protoc-gen-go ; \
    curl -o protoc.zip -L $ZIPPROTOC ;

    RUN apt-get update; apt-get -y install unzip ; \
    unzip protoc.zip -d /usr/local/protoc ;

    ## rm protoc.zip ;

    RUN mix local.hex --force ; \
    mix local.rebar --force ; \
    mix escript.install hex protobuf --force ; \
    mix archive.install hex phx_new 1.4.0 --force ;

    # need to add nodejs for webpack task with phoenix
    RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - ; \
    apt-get install -y nodejs ;

    ####RUN npm install -g @vue/cli ;