mirror of
https://github.com/correl/planning-poker.git
synced 2024-12-26 19:16:54 +00:00
Add Dockerfile
This commit is contained in:
parent
dbe3ec4517
commit
62b2bc2484
2 changed files with 38 additions and 0 deletions
5
.dockerignore
Normal file
5
.dockerignore
Normal file
|
@ -0,0 +1,5 @@
|
|||
_build
|
||||
deps
|
||||
assets/node_modules
|
||||
assets/elm-stuff
|
||||
test
|
33
Dockerfile
Normal file
33
Dockerfile
Normal file
|
@ -0,0 +1,33 @@
|
|||
FROM elixir:1.10.3-alpine AS app_builder
|
||||
|
||||
ENV MIX_ENV=prod \
|
||||
SECRET_KEY_BASE=secret-key-that-should-be-overriden-on-build
|
||||
|
||||
RUN apk add --update nodejs nodejs-npm \
|
||||
&& mix local.hex --force \
|
||||
&& mix local.rebar --force
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
RUN mix deps.get --only prod \
|
||||
&& mix compile \
|
||||
&& npm install --prefix ./assets \
|
||||
&& npm run deploy --prefix ./assets \
|
||||
&& mix phx.digest \
|
||||
&& mix release
|
||||
|
||||
FROM alpine as app
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
RUN apk add --update openssl ncurses-libs \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN adduser -D -h /home/app app
|
||||
WORKDIR /home/app
|
||||
COPY --from=app_builder /app/_build/prod/rel/planningpoker .
|
||||
RUN chown -R app: .
|
||||
USER app
|
||||
|
||||
CMD ["bin/planningpoker", "start"]
|
Loading…
Reference in a new issue