diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..690a5d7 --- /dev/null +++ b/Containerfile @@ -0,0 +1,22 @@ +# Use unstable for the moment, since this requires rustc >= 1.61 +FROM docker.io/library/debian:unstable-slim +RUN apt-get update +RUN apt-get install -y pkg-config build-essential +RUN apt-get install -y cargo +RUN apt-get install -y libssl-dev +RUN mkdir -p /src +RUN mkdir -p /var/lib/haunter +RUN mkdir -p /etc/haunter +WORKDIR /src +COPY ./src ./src +COPY ./Cargo.toml ./ +COPY ./Cargo.lock ./ +RUN cargo build --release +RUN cp target/release/haunter /usr/local/bin/haunter +WORKDIR /var/lib/haunter +RUN rm -rf /src +# Other cleanup +# RUN apt-get purge cargo -y +# RUN apt-get autoremove --purge -y +# RUN apt-get clean +CMD /usr/local/bin/haunter \ No newline at end of file diff --git a/container-compose.yml b/container-compose.yml index 3e26c08..d8f9b92 100644 --- a/container-compose.yml +++ b/container-compose.yml @@ -15,9 +15,19 @@ services: ports: - "${HAUNTER_HTTP_PORT:-8080}:80" volumes: - - ./results.d:/usr/share/nginx/html - # watcher: - # build_context: - # - ./ - # depends_on: - # - driver + - results:/usr/share/nginx/html:ro + watcher: + build: + context: + ./ + depends_on: + - driver + volumes: + - results:/var/lib/haunter/results.d + - jobs:/var/lib/haunter/jobs.d + - conf:/etc/haunter + +volumes: + results: + jobs: + conf: