-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
42 lines (36 loc) · 1.31 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
FROM elixir:1.8.2
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="EmCasa <[email protected]>" \
org.opencontainers.image.title="Backend service for EmCasa." \
org.opencontainers.image.description="Backend service for EmCasa." \
org.opencontainers.image.authors="EmCasa <[email protected]>" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/emcasa/backend" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.created=$BUILD_DATE
# elixir install deps
RUN mix local.hex --force \
&& mix local.rebar --force
# app set workdir
WORKDIR /opt/emcasa/backend
# app install deps
COPY mix.exs mix.exs
COPY mix.lock mix.lock
# NOTE (jpd): there must be a better way to do this
COPY apps/re_integrations/mix.exs apps/re_integrations/mix.exs
COPY apps/re_web/mix.exs apps/re_web/mix.exs
COPY apps/re/mix.exs apps/re/mix.exs
RUN mix deps.get \
&& mix deps.compile
# app copy code
COPY . /opt/emcasa/backend
RUN mix compile
# app expose server port
EXPOSE 4000
# execution copy scripts
COPY priv/docker/scripts/wait-for-it.sh /usr/local/bin/
COPY priv/docker/scripts/docker-entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/wait-for-it.sh \
&& chmod 755 /usr/local/bin/docker-entrypoint.sh
CMD ["/usr/local/bin/docker-entrypoint.sh"]