Created
November 13, 2019 11:53
-
-
Save benyblack/88cbefb3164de983c30831dac8c03943 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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