sergei/Dockerfile
Roman Godmaire f77773f377 chore: Update dependencies
Use the newest versions of plug_cowboy, alpine, and nostrum.  We are
using the git version of Nostrum because v0.8 has a bug in the cache
code
2023-09-07 10:13:26 -04:00

37 lines
701 B
Docker

FROM elixir:alpine AS build_stage
# Config
ENV MIX_ENV prod
WORKDIR /opt/build
# Dependendies
COPY mix.* ./
COPY config ./config
RUN apk add git
RUN mix local.hex --force && \
mix local.rebar --force && \
mix deps.get --only prod && \
mix deps.compile
# Build project
COPY lib ./lib
RUN mix release sergei
FROM alpine:3.18
WORKDIR /opt/sergei
RUN apk add \
--update \
--no-cache \
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
COPY --from=build_stage /opt/build/_build/prod/rel/sergei /opt/sergei
ENTRYPOINT ["/opt/sergei/bin/sergei"]
CMD ["start"]