Skip to content

Commit

Permalink
Fix docker / docker-compose setup
Browse files Browse the repository at this point in the history
  * Update to latest debian Rust image. CMake on the old image was not
    compatible with the wiredtiger build.
  * Eliminate use of cargo watch, we don't need it anymore.
  * Change the build to only copy over the source we need instead of
    all of ./
  • Loading branch information
rdaum committed Oct 16, 2024
1 parent 651752a commit 0bb6dd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Using official rust base image
FROM rust:1.78-bullseye
FROM rust:1.81-bookworm
WORKDIR /moor
RUN apt update
RUN apt -y install clang libclang-dev swig python3-dev cmake
RUN cargo install cargo-watch
EXPOSE 8080
COPY ./ ./
COPY ./crates ./crates
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
COPY ./JHCore-DEV-2.db ./JHCore-DEV-2.db
RUN cargo build --all-targets
23 changes: 12 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ networks:
moor_net:
services:
moor-daemon:
build: ./
build:
context: .
network: host
container_name: "moor-daemon"
volumes:
- ./.cargo/registry:/usr/local/cargo/registry:cached
Expand All @@ -29,18 +31,17 @@ services:
- CARGO_TARGET_DIR=/root/target
working_dir: /moor
command: >
sh -c "RUST_BACKTRACE=1 cargo watch -w crates/kernel -w crates/rpc-common -w crates/daemon -w crates/values -w crates/db -x
'run -p moor-daemon -- development.db --rpc-listen=tcp://0.0.0.0:7899 --events-listen=tcp://0.0.0.0:7898 --textdump=JHCore-DEV-2.db --generate-keypair --textdump-out=out.db'"
sh -c "RUST_BACKTRACE=1 cargo run -p moor-daemon -- development.db --rpc-listen=tcp://0.0.0.0:7899 --events-listen=tcp://0.0.0.0:7898 --textdump=JHCore-DEV-2.db --generate-keypair --textdump-out=out.db"
ports:
# ZMQ ports
- "7899:7899"
- "7898:7898"
# HTTP port for prometheus endpoint for metrics export
- "9000:9000"
networks:
- moor_net
moor-telnet-host:
build: ./
build:
context: .
network: host
container_name: "moor-telnet-host"
volumes:
- ./.cargo/registry:/usr/local/cargo/registry:cached
Expand All @@ -50,15 +51,16 @@ services:
- CARGO_TARGET_DIR=/root/target
working_dir: /moor
command: >
sh -c "RUST_BACKTRACE=1 cargo watch -w crates/rpc-common -w crates/telnet-host -w crates/values -x
'run -p moor-telnet-host -- --telnet-address=0.0.0.0:8888 --rpc-address=tcp://moor-daemon:7899 --events-address=tcp://moor-daemon:7898'"
sh -c "RUST_BACKTRACE=1 cargo run -p moor-telnet-host -- --telnet-address=0.0.0.0:8888 --rpc-address=tcp://moor-daemon:7899 --events-address=tcp://moor-daemon:7898"
ports:
# Telnet listener
- "8888:8888"
networks:
- moor_net
moor-web-host:
build: ./
build:
context: .
network: host
container_name: "moor-web-host"
volumes:
- ./.cargo/registry:/usr/local/cargo/registry:cached
Expand All @@ -68,8 +70,7 @@ services:
- CARGO_TARGET_DIR=/root/target
working_dir: /moor
command: >
sh -c "RUST_BACKTRACE=1 cargo watch -w crates/rpc-common -w crates/web-host -w crates/values -x
'run -p moor-web-host -- --listen-address=0.0.0.0:8080 --rpc-address=tcp://moor-daemon:7899 --events-address=tcp://moor-daemon:7898'"
sh -c "RUST_BACKTRACE=1 cargo run -p moor-web-host -- --listen-address=0.0.0.0:8080 --rpc-address=tcp://moor-daemon:7899 --events-address=tcp://moor-daemon:7898"
ports:
# HTTP listener
- "8080:8080"
Expand Down

0 comments on commit 0bb6dd6

Please sign in to comment.