-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (38 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
48 lines (38 loc) · 1.3 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
# Multi-stage Dockerfile optimized for caching and minimal final image size
FROM rust:bookworm AS builder
WORKDIR /app
# Install required system dependencies
RUN apt-get update && apt-get install -y \
cmake \
pkg-config \
libssl-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy source code
COPY . .
# Build the application, optionally enabling experimental features
ARG ENABLE_EXPERIMENTAL=false
RUN if [ "$ENABLE_EXPERIMENTAL" = "true" ]; then \
echo "Building embucketd with experimental features enabled"; \
cargo build --release --bin embucketd --features experimental; \
else \
echo "Building embucketd without experimental features"; \
cargo build --release --bin embucketd --no-default-features; \
fi
# Stage 4: Final runtime image
FROM gcr.io/distroless/cc-debian12 AS runtime
# Set working directory
USER nonroot:nonroot
WORKDIR /app
# Copy the binary and required files
COPY --from=builder /app/target/release/embucketd ./embucketd
COPY --from=builder /app/rest-catalog-open-api.yaml ./rest-catalog-open-api.yaml
# Expose port (adjust as needed)
EXPOSE 8080
EXPOSE 3000
ENV OBJECT_STORE_BACKEND=file
ENV FILE_STORAGE_PATH=data/
ENV BUCKET_HOST=0.0.0.0
ENV JWT_SECRET=63f4945d921d599f27ae4fdf5bada3f1
# Default command
CMD ["./embucketd"]