feat(docker): add docker functionality.
parent
fabaafbbe7
commit
e4f14f9531
@ -0,0 +1,6 @@
|
||||
.idea/
|
||||
target/
|
||||
files/
|
||||
*.iml
|
||||
*.log
|
||||
config.toml
|
@ -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"]
|
@ -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
|
@ -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 New Issue