-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
45 lines (34 loc) · 1.05 KB
/
Dockerfile
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
# Start with a Rust base image
FROM rust:latest as builder
# Install protobuf compiler
RUN apt-get update && apt-get install -y protobuf-compiler
# Create a new empty shell project
RUN USER=root cargo new --bin replit-takeout
WORKDIR /replit-takeout
# Copy the Cargo manifests
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
# Build dependencies first to cache them
# RUN cargo build --release
# RUN rm src/*.rs
COPY ./src ./src
# Build for release
# RUN rm ./target/release/deps/replit_takeout*
RUN cargo build --release
# Start a new stage with a newer base image
FROM debian:bookworm-slim
# Install necessary dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release \
sudo \
libssl-dev \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Copy the release binary from the builder stage
COPY --from=builder /replit-takeout/target/release/replit-takeout /usr/local/bin/replit-takeout
ENV RUST_LOG="debug"
# Set the startup command
CMD ["sh", "-c", "/usr/local/bin/replit-takeout"]