-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (35 loc) · 983 Bytes
/
Dockerfile
File metadata and controls
48 lines (35 loc) · 983 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
40
41
42
43
44
45
46
47
48
# Multi-stage build for LiNa Store
# Stage 1: Build stage
FROM rust:1.87.0-alpine3.22 AS builder
# Install build dependencies
RUN apk add --no-cache \
pkgconfig \
openssl-dev \
musl-dev \
sqlite-dev \
zlib-dev \
build-base
# Set working directory
WORKDIR /app
# Copy Cargo files for dependency caching
COPY . .
# Build dependencies only (this layer will be cached if Cargo files don't change)
RUN cargo build --release
# Stage 2: Runtime stage
FROM alpine:3.22
# Install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
openssl
# Set working directory
WORKDIR /app
# Copy binary from builder stage
COPY --from=builder /app/target/release/linastore-server /usr/local/bin/
# Switch to non-root user
USER root
# Expose default ports (adjust based on your application needs)
EXPOSE 8086 8096
# Set environment variables
ENV RUST_LOG=info
# Default command
CMD ["linastore-server"]