-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathDockerfile.multi-step
More file actions
35 lines (25 loc) · 927 Bytes
/
Dockerfile.multi-step
File metadata and controls
35 lines (25 loc) · 927 Bytes
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
FROM supabase/logflare:base AS builder
ENV MIX_ENV=prod
WORKDIR /app
COPY ./VERSION mix.exs mix.lock ./
COPY config/config.exs config/
COPY config/prod.exs config/
COPY config/runtime.exs config/
RUN mix do deps.get + deps.compile
COPY . ./
# release
RUN mix release && \
npm run --prefix assets deploy && \
mix phx.digest
FROM supabase/logflare:runner
# Copy required files from builder step
COPY --from=builder /app/_build/prod /opt/app
COPY --from=builder /app/VERSION /opt/app/VERSION
COPY --from=builder /app/priv/static /opt/app/rel/logflare/bin/priv/static
# Move files to the correct folder taking into consideration the VERSION
RUN cp -r /opt/app/rel/logflare/bin/priv/static /opt/app/rel/logflare/lib/logflare-$(cat /opt/app/VERSION)/priv/static
# Cleanup static assets not in use
RUN rm -r /opt/app/rel/logflare/bin/priv
WORKDIR /opt/app/rel/logflare/bin
COPY run.sh ./run.sh
CMD ["sh", "run.sh"]