Skip to content

Instantly share code, notes, and snippets.

@benyblack
Created November 13, 2019 11:53
Show Gist options
  • Save benyblack/88cbefb3164de983c30831dac8c03943 to your computer and use it in GitHub Desktop.
Save benyblack/88cbefb3164de983c30831dac8c03943 to your computer and use it in GitHub Desktop.
FROM elixir:1.9.2
RUN mkdir /app
WORKDIR /app
ENV MIX_ENV=dev
# Install needed packages
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get update && apt-get -y install curl inotify-tools nodejs
RUN mix local.hex --force
RUN mix local.rebar --force
# Install depencencies
COPY mix.exs mix.lock ./
RUN mix deps.get
# Copy needed files
COPY ./config ./config
COPY ./lib ./lib
COPY ./priv ./priv
COPY ./test ./test
# Build client-side stuff
COPY ./assets ./assets
RUN cd assets && npm install
# Final build
RUN cd assets && \
npm run deploy && \
cd .. && \
mix do compile, phx.digest
EXPOSE ${PORT}
ENTRYPOINT ["mix", "phx.server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment