diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a33e906 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM rust:1.57.0-bullseye as builder + +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + nodejs \ + gcc \ + g++ \ + make \ + musl-tools \ + && rm -rf /var/lib/apt/lists/* + +RUN npm install --global yarn + +RUN rustup target add x86_64-unknown-linux-musl + +ADD . ./ + +RUN make + +FROM debian:bullseye-slim + +COPY --from=builder /release/hastic /hastic +COPY --from=builder /release/config.toml /config.toml +COPY --from=builder /release/public /public + +CMD ["./hastic"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fa30b05 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ + +version: '3' +services: + app: + image: hastic/hastic:latest + network_mode: host + restart: always + environment: + HASTIC_PORT: "4347" + HASTIC_PROMETHEUS__URL: "http://demo.robustperception.io:9090" + HASTIC_PROMETHEUS__QUERY: "rate(go_memstats_alloc_bytes_total[1m])" + ports: + - "4347:4347"