diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d8259c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# This Dockerfile results in a super small container containing only the miniserve binary and nothing else. +# Use this in case you don't need any additional tools in the container. +FROM rust as builder + +ENV APP_HOME /usr/src/app/ + +RUN rustup target add x86_64-unknown-linux-musl +RUN apt-get update && apt-get install -y upx musl-tools + +COPY . $APP_HOME +WORKDIR $APP_HOME +RUN make build-linux + +FROM scratch +COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/miniserve /app/ + +EXPOSE 8080 +ENTRYPOINT ["/app/miniserve"] |