This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
63 lines (46 loc) · 1.74 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
##################################################
# Stage: builder
##################################################
FROM elixir:1.14.1-alpine as builder
ENV MIX_HOME=/opt/mix \
HEX_HOME=/opt/hex \
APP_HOME=/opt/app \
ERL_AFLAGS="-kernel shell_history enabled"
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
RUN apk --no-cache --update-cache --available upgrade \
&& apk add --no-cache --update-cache bash ca-certificates libstdc++ build-base git inotify-tools nodejs npm yarn \
&& mix do local.hex --force, local.rebar --force \
&& update-ca-certificates --fresh
SHELL ["/bin/bash", "-c"]
COPY etc /etc/
RUN find /etc/bashrc.d/ -name "*.sh" -exec chmod -v +x {} \;
COPY .bashrc /root/
COPY opt/scripts/ /opt/scripts
ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /opt/scripts/
RUN find /opt/scripts/ -name "*.sh" -exec chmod -v +x {} \;
ENV PATH=/opt/scripts/:$PATH
ENTRYPOINT ["entrypoint.sh"]
CMD ["mix", "phx.server"]
EXPOSE 4000
##################################################
# Stage: runtime
##################################################
FROM alpine:3.16.2 as runtime
ENV APP_HOME=/opt/app \
ERL_AFLAGS="-kernel shell_history enabled"
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
RUN apk --no-cache --update-cache --available upgrade \
&& apk add --no-cache --update-cache bash ca-certificates libstdc++ openssl ncurses-libs \
&& update-ca-certificates --fresh
SHELL ["/bin/bash", "-c"]
COPY --from=builder /etc/bashrc.d /etc/bashrc.d
COPY --from=builder /etc/bash.bashrc /etc/bash.bashrc
COPY --from=builder /opt/scripts /opt/scripts
COPY .bashrc /root/
RUN chown -R nobody:nobody /opt
ENV PATH=/opt/scripts/:$PATH
ENTRYPOINT ["entrypoint.sh"]
CMD ["bash", "-c", "$RELEASE_NAME start"]
EXPOSE 4000