-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (48 loc) · 1.66 KB
/
Dockerfile
File metadata and controls
59 lines (48 loc) · 1.66 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
55
56
57
58
59
# ---------------------------------------------------
# Stage 1: Build Dashboard (Frontend)
# ---------------------------------------------------
FROM node:20-slim AS frontend-builder
WORKDIR /app/dashboard
COPY dashboard/package*.json ./
RUN npm ci
COPY dashboard/ .
# Builds static files to /app/dashboard/dist
RUN npm run build
# ---------------------------------------------------
# Stage 2: Build Orbit Server (Backend)
# ---------------------------------------------------
FROM rust:1.81-slim-bookworm AS backend-builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy manifest files to cache dependencies
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
COPY src/ src/
COPY .cargo/ .cargo/
# Build the server specifically
RUN cargo build --release --package orbit-server
# ---------------------------------------------------
# Stage 3: Runtime
# ---------------------------------------------------
FROM debian:bookworm-slim
WORKDIR /app
# Install necessary runtime libs (OpenSSL, ca-certificates)
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Copy Binary
COPY --from=backend-builder /app/target/release/orbit-server /usr/local/bin/orbit-server
# Copy Frontend Assets
# Assuming orbit-server is configured to serve static files from ./public or similar
# You may need to adjust the destination based on your orbit-server config
COPY --from=frontend-builder /app/dashboard/dist /app/static
ENV ORBIT_HOST=0.0.0.0
ENV ORBIT_PORT=3000
ENV ORBIT_STATIC_DIR=/app/static
EXPOSE 3000
CMD ["orbit-server"]