forked from OtowoOrg/Stellar-K8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
30 lines (22 loc) · 774 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
30 lines (22 loc) · 774 Bytes
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
# Development Dockerfile with cargo-watch for hot-reloading
FROM rust:1.94-bookworm
WORKDIR /app
# Install cargo-watch for hot-reloading
RUN cargo install cargo-watch
# Install kubectl for K8s API interaction
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
&& chmod +x kubectl \
&& mv kubectl /usr/local/bin/
# Copy dependency manifests for caching
COPY Cargo.toml Cargo.lock ./
COPY build.rs ./
# Create dummy source to cache dependencies
RUN mkdir -p src && \
echo "fn main() {}" > src/main.rs && \
cargo build && \
rm -rf src
# Copy actual source code
COPY . .
# Expose ports
EXPOSE 8080 9090
CMD ["cargo", "watch", "-x", "run -- run --namespace stellar-system --dry-run"]