initial Dockerfile (works, but image is BIG)

This commit is contained in:
Pavel 2024-05-25 22:34:06 +03:00
parent a9e21891c5
commit 96fd9de230
3 changed files with 14 additions and 1 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target

View File

@ -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 FROM alpine:latest
RUN apk add --no-cache ffmpeg-libavutil ffmpeg-libavformat ffmpeg-libavfilter ffmpeg-libavdevice clang16 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"]

View File

@ -29,4 +29,5 @@ curl --location 'http://localhost:8090/enqueue' \
- [ ] Remove transcoding result after uploading it to the `uploadUrl`. - [ ] Remove transcoding result after uploading it to the `uploadUrl`.
- [ ] (Optional) Make `uploadUrl` optional and allow the client to download the file on-demand. - [ ] (Optional) Make `uploadUrl` optional and allow the client to download the file on-demand.
- [ ] Docker image for `amd64` and `aarch64`. - [ ] Docker image for `amd64` and `aarch64`.
- [ ] Statically linked binary for Docker image & result docker image based on `scratch` (reduce image size).
- [ ] Tests! - [ ] Tests!