diff --git a/filed/.gitignore b/filed/.gitignore index ea8c4bf..73bbc30 100644 --- a/filed/.gitignore +++ b/filed/.gitignore @@ -1 +1,2 @@ /target +Dockerfile \ No newline at end of file diff --git a/filed/Dockerfile b/filed/Dockerfile.dev similarity index 100% rename from filed/Dockerfile rename to filed/Dockerfile.dev diff --git a/filed/Dockerfile.prod b/filed/Dockerfile.prod new file mode 100644 index 0000000..ee3dff5 --- /dev/null +++ b/filed/Dockerfile.prod @@ -0,0 +1,13 @@ +# --- build --- +FROM rust:alpine as builder + +WORKDIR /opt/build +COPY . . + +RUN cargo b -r + +# --- deploy --- +FROM alpine + +COPY --from=builder /opt/build/target/release/filed /bin/filed +CMD [ "/bin/filed" ] diff --git a/filed/README.md b/filed/README.md index 2962c6b..2a1e4b0 100644 --- a/filed/README.md +++ b/filed/README.md @@ -1,3 +1,8 @@ # fileD - file daemon This is a part of blek! File that is responsible for serving and uploading files. This module is released under the GPLv3 with additions, copy of which is included in the top level of this repository. + +## Building +To get started with this, copy either `Dockerfile.dev` or `Dockerfile.prod` to `Dockerfile`, depending on your environment. + +Then either build it manually or start it up using the `docker-compose.yml` file, which is provided in the top level directory. diff --git a/filed/dev-entry.sh b/filed/dev-entry.sh new file mode 100755 index 0000000..5b832d9 --- /dev/null +++ b/filed/dev-entry.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +cargo check +cargo build + +cargo watch -w src -w templates -x run \ No newline at end of file