-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backend
More file actions
39 lines (29 loc) · 1.03 KB
/
Copy pathDockerfile.backend
File metadata and controls
39 lines (29 loc) · 1.03 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
# Dockerfile for the Ito backend API server (local testing).
#
# Multi-stage build:
# 1. Build the `ito` binary with the `backend` feature (default).
# 2. Copy the binary into a minimal runtime image.
#
# Usage:
# docker compose -f docker-compose.backend.yml up --build
#
# The entrypoint runs `ito backend serve` with bind 0.0.0.0 so the port is
# accessible from the Docker host.
# ---------- build stage ----------
FROM rust:1.86-bookworm AS builder
WORKDIR /src
# Copy workspace manifests first for layer caching.
COPY Cargo.toml Cargo.lock ./
COPY ito-rs/crates/ ito-rs/crates/
RUN cargo build --release --bin ito
# ---------- runtime stage ----------
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /src/target/release/ito /usr/local/bin/ito
# Default data directory inside the container.
ENV ITO_BACKEND_DATA_DIR=/data
EXPOSE 9010
ENTRYPOINT ["ito", "backend", "serve", "--bind", "0.0.0.0"]