feat(docker): add docker functionality.
This commit is contained in:
parent
fabaafbbe7
commit
e4f14f9531
6 changed files with 61 additions and 3 deletions
6
.dockerignore
Normal file
6
.dockerignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.idea/
|
||||||
|
target/
|
||||||
|
files/
|
||||||
|
*.iml
|
||||||
|
*.log
|
||||||
|
config.toml
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
# runtime files
|
# runtime files
|
||||||
*.log
|
*.log
|
||||||
/files
|
|
||||||
|
|
||||||
# config
|
# dev files
|
||||||
config.toml
|
config.toml
|
||||||
|
/files
|
||||||
|
docker-compose.yml
|
||||||
|
|
30
Dockerfile
Normal file
30
Dockerfile
Normal 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"]
|
|
@ -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
|
keep_file_structure = true # e.g. /data/input/foo/bar.mp4 -> /data/output/foo/bar.webm
|
||||||
|
|
||||||
[files.cleanup]
|
[files.cleanup]
|
||||||
enabled = true
|
enabled = true # do cleanup?
|
||||||
original_cleanup_behavior = "delete" # delete, archive or keep
|
original_cleanup_behavior = "delete" # delete, archive or keep
|
||||||
|
|
||||||
[files.cleanup.archive]
|
[files.cleanup.archive]
|
||||||
|
|
10
docker/docker-entrypoint.d/00-preflight.sh
Normal file
10
docker/docker-entrypoint.d/00-preflight.sh
Normal 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
|
11
docker/docker-entrypoint.sh
Normal file
11
docker/docker-entrypoint.sh
Normal 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
|
Loading…
Reference in a new issue