forked from lnay/cratedocs-mcp
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 860 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 860 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
31
32
33
34
35
36
37
38
39
FROM rust:1.91.1-slim-bullseye AS builder
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
libssl-dev \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Cache dependency compilation
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo fetch
RUN rm -rf src
# Copy the full source tree
COPY . .
RUN cargo build --locked --release --bin cratedocs
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y ca-certificates libssl1.1 && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/cratedocs /usr/local/bin/cratedocs
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8080
ENV CRATEDOCS_MODE=http \
CRATEDOCS_ADDRESS=0.0.0.0:8080 \
CRATEDOCS_DEBUG=false
ENTRYPOINT ["/entrypoint.sh"]