diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1de5659 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d9e8cda..dc65683 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,13 @@ +FROM alpine:latest AS builder +WORKDIR /build +COPY ./ ./ +ARG PKG_CONFIG_PATH=/usr/lib/pkgconfig +RUN apk add --no-cache ffmpeg-libs ffmpeg-dev clang16 clang16-libclang pkgconf rust cargo +RUN cd /build && cargo build --release + FROM alpine:latest -RUN apk add --no-cache ffmpeg-libavutil ffmpeg-libavformat ffmpeg-libavfilter ffmpeg-libavdevice clang16 \ No newline at end of file +WORKDIR / +RUN apk add --no-cache ffmpeg-libavutil ffmpeg-libavformat ffmpeg-libavfilter ffmpeg-libavdevice dumb-init mailcap tzdata +COPY --from=builder /build/target/release/atranscoder-rpc /usr/local/bin +EXPOSE 8090 +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/atranscoder-rpc"] diff --git a/README.md b/README.md index 2ce9f37..1baedca 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,5 @@ curl --location 'http://localhost:8090/enqueue' \ - [ ] Remove transcoding result after uploading it to the `uploadUrl`. - [ ] (Optional) Make `uploadUrl` optional and allow the client to download the file on-demand. - [ ] Docker image for `amd64` and `aarch64`. +- [ ] Statically linked binary for Docker image & result docker image based on `scratch` (reduce image size). - [ ] Tests! \ No newline at end of file