Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
54 lines (43 loc) · 1.65 KB
/
Copy pathDockerfile.dev
File metadata and controls
54 lines (43 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Development Dockerfile for RLM Server
#
# This Dockerfile is optimized for development with:
# - Cargo watch for hot reloading
# - Debug tools and utilities
# - Volume mounts for source code
FROM rust:1.91.1-slim-bookworm
# Install development dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
ca-certificates \
curl \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install cargo tools for development
RUN cargo install cargo-watch cargo-expand cargo-audit
# Set working directory
WORKDIR /app
# Copy workspace configuration
COPY Cargo.toml Cargo.lock ./
# Install dependencies (will be cached)
RUN mkdir -p crates/rlm-core/src crates/rlm-repl-rhai/src crates/rlm-server/src crates/rlm-ffi/src crates/rlm-uar-adapter/src && \
echo "fn main() {}" > crates/rlm-core/src/lib.rs && \
echo "fn main() {}" > crates/rlm-repl-rhai/src/lib.rs && \
echo "fn main() {}" > crates/rlm-server/src/lib.rs && \
echo "fn main() {}" > crates/rlm-server/src/main.rs && \
echo "fn main() {}" > crates/rlm-ffi/src/lib.rs && \
echo "fn main() {}" > crates/rlm-uar-adapter/src/lib.rs
COPY crates/rlm-core/Cargo.toml crates/rlm-core/
COPY crates/rlm-repl-rhai/Cargo.toml crates/rlm-repl-rhai/
COPY crates/rlm-server/Cargo.toml crates/rlm-server/
COPY crates/rlm-ffi/Cargo.toml crates/rlm-ffi/
COPY crates/rlm-uar-adapter/Cargo.toml crates/rlm-uar-adapter/
# Build dependencies
RUN cargo build --bin rlm-server
# Remove the dummy source files
RUN rm -rf crates/*/src
# Expose ports
EXPOSE 8080 9229
# Default development command (will be overridden by docker-compose)
CMD ["cargo", "run", "--bin", "rlm-server"]