-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
47 lines (34 loc) · 983 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM hexpm/elixir:1.14.5-erlang-24.0.3-alpine-3.16.0 as base
RUN addgroup -g 1000 -S devgroup && adduser -u 1000 -S devuser -G devgroup
USER devuser
COPY .build-deps /
RUN cat .build-deps | xargs apk add --no-cache
WORKDIR /app
COPY mix* ./
RUN mix do \
local.hex --force, \
local.rebar --force
RUN mix deps.get
# Development image
FROM base as dev
ENV ERL_AFLAGS="-kernel shell_history enabled"
ENV MIX_ENV=dev
COPY . ./
# Release image
FROM base as release
# we release in production mode, see config/prod.exs for details
ENV MIX_ENV=prod
COPY lib lib
COPY config config
COPY README.md README.md
RUN mix do compile, release
# bind to 0.0.0.0
ENV MIMICRY_IP 0.0.0.0
# internally bound port
ENV MIMICRY_PORT 8080
# copy over the built release
RUN cp -r /app/_build/prod/rel/mimicry/* /app
RUN find /app -executable -type f -exec chmod +x {} +
# create the entry folder for specifications on startup
RUN mkdir /specifications
CMD [ "/app/bin/mimicry", "start" ]