-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathdockerfile-startos
More file actions
37 lines (27 loc) · 978 Bytes
/
dockerfile-startos
File metadata and controls
37 lines (27 loc) · 978 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
# Build stage
FROM rust:1.86-alpine AS builder
# Install build dependencies
RUN apk update && \
apk add --no-cache build-base sqlite-dev pkgconfig git
# Set working directory
WORKDIR /mostro
# Copy Cargo.toml and Cargo.lock to leverage Docker cache
COPY Cargo.toml Cargo.lock ./
RUN cargo fetch
# Copy source code
COPY . .
# Build the project in release mode
RUN cargo build --release --features startos
# Production stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache ca-certificates sqlite-libs && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing grpcurl
# Create the mostro data directory
RUN mkdir -p /mostro
# Set working directory to /mostro for persistent data
WORKDIR /mostro
# Copy proto files from build stage for grpcurl health checks
COPY --from=builder /mostro/proto /proto
# Copy built binary from build stage
COPY --from=builder /mostro/target/release/mostrod /usr/local/bin/mostrod