forked from ed-asriyan/lottie-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (41 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM rust:alpine as builder-gifski
MAINTAINER Ed Asriyan <[email protected]>
# https://stackoverflow.com/a/30873179
RUN apk add --no-cache musl-dev
RUN cargo install --version 1.7.0 gifski
FROM alpine as builder-tgs-to-png
MAINTAINER Ed Asriyan <[email protected]>
RUN apk update && \
apk --no-cache add \
build-base \
git \
gcc \
g++ \
cmake \
libstdc++ \
py-pip && \
pip install --ignore-installed conan
WORKDIR /application
ADD conanfile.txt .
RUN conan install . --build=missing
ADD CMakeLists.txt .
ADD src src
RUN cmake CMakeLists.txt && make
FROM alpine
WORKDIR /application
RUN apk --no-cache add libwebp-tools
COPY --from=builder-gifski /usr/local/cargo/bin/gifski /usr/local/bin/gifski
COPY --from=builder-tgs-to-png /application/bin/tgs_to_png /application/bin/tgs_to_png
ADD tgs_to_png.sh .
ADD tgs_to_webp.sh .
ADD tgs_to_gif.sh .
ENV WIDTH=512
ENV HEIGHT=512
ENV FPS=50
ENV QUALITY=90
ENV FORMAT=gif
CMD sh -c "\
find /source -name '*.tgs' | while IFS=$'\n' read -r FILE; do \
echo Converting \${FILE}... && /application/tgs_to_\${FORMAT}.sh --width \$WIDTH --height \$HEIGHT --fps \$FPS --quality \$QUALITY \$FILE && echo Done.; \
done\
"