forked from teslamate-org/teslamate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (29 loc) · 954 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 elixir:1.9-alpine AS builder
RUN apk add --update --no-cache nodejs yarn git build-base python && \
mix local.rebar --force && \
mix local.hex --force
ENV MIX_ENV=prod
WORKDIR /opt/app
COPY mix.exs mix.lock ./
RUN mix do deps.get --only $MIX_ENV, deps.compile
COPY assets assets
RUN (cd assets && yarn install && yarn deploy)
COPY config config
COPY lib lib
COPY priv priv
RUN mix do phx.digest, compile
RUN mkdir -p /opt/built && mix release --path /opt/built
########################################################################
FROM alpine:3.10 AS app
ENV LANG=C.UTF-8 \
SRTM_CACHE=/opt/app/.srtm_cache \
HOME=/opt/app
RUN apk add --update --no-cache bash openssl tzdata
WORKDIR $HOME
COPY --chown=nobody entrypoint.sh /
COPY --from=builder --chown=nobody /opt/built .
RUN mkdir .srtm_cache && chown -R nobody: .
USER nobody
EXPOSE 4000
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
CMD ["bin/teslamate", "start"]