mirror of https://github.com/ivanch/tcc.git
35 lines
940 B
Docker
35 lines
940 B
Docker
FROM rust:slim-bullseye AS build-env
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN apt update && apt install wget -y && \
|
|
wget https://files.ivanch.me/api/public/dl/iFuXSNhw/small-image.png && \
|
|
wget https://files.ivanch.me/api/public/dl/81Bkht5C/big-image.png && \
|
|
wget https://files.ivanch.me/api/public/dl/nAndfAjK/video.mp4 && \
|
|
mv small-image.png ./static && \
|
|
mv big-image.png ./static && \
|
|
mv video.mp4 ./static
|
|
|
|
RUN cargo build --release
|
|
|
|
FROM debian:bullseye-slim
|
|
|
|
ENV MAGICK_VERSION 7.1
|
|
|
|
RUN curl https://imagemagick.org/archive/ImageMagick.tar.gz | tar xz \
|
|
&& cd ImageMagick-${MAGICK_VERSION}* \
|
|
&& ./configure --with-magick-plus-plus=no --with-perl=no \
|
|
&& make \
|
|
&& make install \
|
|
&& cd .. \
|
|
&& rm -r ImageMagick-${MAGICK_VERSION}*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build-env /app/target/release .
|
|
COPY --from=build-env /app/static ./static
|
|
|
|
ENTRYPOINT ["./ActixAPI"]
|