feat(docker): add docker functionality.

This commit is contained in:
Didier Slof 2023-05-07 21:08:14 +02:00
parent fabaafbbe7
commit e4f14f9531
Signed by: didier
GPG Key ID: 01E71F18AA4398E5
6 changed files with 61 additions and 3 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
.idea/
target/
files/
*.iml
*.log
config.toml

5
.gitignore vendored
View File

@ -7,7 +7,8 @@
# runtime files
*.log
/files
# config
# dev files
config.toml
/files
docker-compose.yml

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM rust
COPY Cargo.toml /app/Cargo.toml
WORKDIR /app
RUN mkdir src && \
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
cargo build --release && \
rm -r target/release/deps/bumblebee*
COPY src /app/src
RUN cargo build --release
RUN cp target/release/bumblebee /app/bumblebee
# -- #
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
COPY docker/docker-entrypoint.d/ /docker-entrypoint.d
RUN chmod +x /docker-entrypoint.sh
ENV CONFIG_PATH=/config/config.toml
VOLUME /config
VOLUME /data/input
VOLUME /data/output
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@ -5,7 +5,7 @@ include = [ 'mp4', 'avi', 'mkv' ] # file extensions to include
keep_file_structure = true # e.g. /data/input/foo/bar.mp4 -> /data/output/foo/bar.webm
[files.cleanup]
enabled = true
enabled = true # do cleanup?
original_cleanup_behavior = "delete" # delete, archive or keep
[files.cleanup.archive]

View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
[ -z "$DEBUG" ] || set -x
if [ ! -f /app/bumblebee ]; then
echo "$0: /app/bumblebee not found, I can't start!!"
exit 1
fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
set -e
for file in /docker-entrypoint.d/*; do
echo "$0: running $file"
sh "$file"
done
cd /app
exec ./bumblebee