diff --git a/ActixAPI/.dockerignore b/ActixAPI/.dockerignore new file mode 100644 index 0000000..8487999 --- /dev/null +++ b/ActixAPI/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +target/ \ No newline at end of file diff --git a/ActixAPI/Dockerfile b/ActixAPI/Dockerfile index 6270dff..aa2f7da 100644 --- a/ActixAPI/Dockerfile +++ b/ActixAPI/Dockerfile @@ -1,23 +1,10 @@ -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 +FROM rust:latest ENV MAGICK_VERSION 7.1 +RUN apt-get update \ + && apt-get -y install wget curl build-essential clang pkg-config libjpeg-turbo-progs libpng-dev + RUN apt update && apt install curl -y \ && curl https://imagemagick.org/archive/ImageMagick.tar.gz | tar xz \ && cd ImageMagick-${MAGICK_VERSION}* \ @@ -29,7 +16,19 @@ RUN apt update && apt install curl -y \ WORKDIR /app -COPY --from=build-env /app/target/release . -COPY --from=build-env /app/static ./static +RUN 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 + +COPY . . + +RUN cargo build --release && \ + cp ./target/release/ActixAPI . && \ + mv small-image.png ./static && \ + mv big-image.png ./static && \ + mv video.mp4 ./static && \ + ldconfig /usr/local/lib + +ENV LD_LIBRARY_PATH=/usr/local/lib ENTRYPOINT ["./ActixAPI"]