Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Feb 2, 2021
1 parent 28d0c2a commit a8d8617
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_build
deps
assets/node_modules
priv/static
22 changes: 22 additions & 0 deletions ops/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM elixir:1.11-alpine as build
ENV MIX_ENV=prod
COPY . .
RUN apk add git npm build-base && \
mix local.hex --force && \
mix local.rebar --force && \
mix deps.get && \
cd assets && \
npm ci && \
npm run deploy && \
cd .. && \
mix phx.digest && \
mix release

FROM elixir:1.11-alpine
ENV HOME=/opt/app
WORKDIR ${HOME}
COPY --from=build _build/prod/rel/keila ${HOME}
RUN mkdir -p ${HOME} && \
adduser -s /bin/sh -u 1001 -G root -h ${HOME} -S -D default && \
chown -R 1001:0 ${HOME}
ENTRYPOINT ["/opt/app/bin/keila"]

0 comments on commit a8d8617

Please sign in to comment.