forked from jackjoe/mailgun_logger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (33 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (33 loc) · 1.04 KB
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 registry.gitlab.com/jack-joe-open-source/docker-images/elixir-phx AS builder
ARG MIX_ENV=prod
ENV PORT ${PORT:-5050}
ENV HOST ${HOST:-localhost}
# Create and set home directory
ENV HOME /opt/app
WORKDIR $HOME
# Copy all application files
COPY . ./
# Install all production dependencies + digest
RUN mix deps.get --only prod && \
mix deps.compile --include-children && \
mix phx.digest
RUN mix release production
##################################################
FROM registry.gitlab.com/jack-joe-open-source/docker-images/alpine
ARG APP_VSN
ARG APP_NAME
ARG MIX_ENV=prod
# Env vars
# Create and set home directory
ENV HOME /opt/app
ENV APP_NAME $APP_NAME
ENV PORT ${PORT:-5050}
WORKDIR $HOME
EXPOSE $PORT
COPY --from=builder $HOME/_build/$MIX_ENV/rel/production $HOME
COPY --from=builder $HOME/script/wait-for $HOME
COPY rel/start.sh .
RUN chmod +x $HOME/start.sh
RUN chmod +x $HOME/wait-for
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD curl --fail -s http://localhost:$PORT/health || exit 1
ENTRYPOINT ["/opt/app/start.sh"]