2023-06-06 21:01:17 +00:00
|
|
|
FROM elixir:alpine AS build_stage
|
2023-06-06 21:01:17 +00:00
|
|
|
|
2023-06-06 21:01:17 +00:00
|
|
|
# Config
|
|
|
|
ENV MIX_ENV prod
|
|
|
|
WORKDIR /opt/build
|
2023-06-06 21:01:17 +00:00
|
|
|
|
2023-06-06 21:01:17 +00:00
|
|
|
# Dependendies
|
|
|
|
COPY mix.* ./
|
|
|
|
COPY config ./config
|
2023-06-06 21:01:17 +00:00
|
|
|
|
2023-06-06 21:01:17 +00:00
|
|
|
RUN mix local.hex --force && \
|
|
|
|
mix local.rebar --force && \
|
|
|
|
mix deps.get --only prod && \
|
|
|
|
mix deps.compile
|
2023-06-06 21:01:17 +00:00
|
|
|
|
2023-06-06 21:01:17 +00:00
|
|
|
# Build project
|
|
|
|
COPY lib ./lib
|
|
|
|
RUN mix release sergei
|
|
|
|
|
|
|
|
FROM elixir:alpine
|
|
|
|
|
|
|
|
WORKDIR /opt/sergei
|
|
|
|
RUN apk add ffmpeg yt-dlp
|
|
|
|
COPY --from=build_stage /opt/build/_build/prod/rel/sergei /opt/sergei
|
|
|
|
|
|
|
|
ENTRYPOINT ["/opt/sergei/bin/sergei"]
|
|
|
|
CMD ["start"]
|