sergei/Dockerfile

37 lines
685 B
Docker
Raw Normal View History

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
2023-06-06 21:01:17 +00:00
FROM alpine:3.16
2023-06-06 21:01:17 +00:00
WORKDIR /opt/sergei
2023-06-06 21:01:17 +00:00
RUN apk add \
--update \
--no-cache \
2023-06-06 21:01:17 +00:00
libstdc++ ncurses openssl \
ffmpeg python3
RUN wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
RUN chmod +x yt-dlp
RUN mv yt-dlp /usr/bin/yt-dlp
2023-06-06 21:01:17 +00:00
COPY --from=build_stage /opt/build/_build/prod/rel/sergei /opt/sergei
ENTRYPOINT ["/opt/sergei/bin/sergei"]
CMD ["start"]