-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 1.05 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (25 loc) · 1.05 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
# -- Builder stage --
FROM rustlang/rust:nightly-slim AS builder
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
COPY src/ src/
COPY tests/ tests/
RUN cargo build --release
# -- Runtime stage --
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y ca-certificates wget && rm -rf /var/lib/apt/lists/*
# Install Litestream
ARG LITESTREAM_VERSION=v0.3.13
RUN wget -q "https://github.com/benbjohnson/litestream/releases/download/${LITESTREAM_VERSION}/litestream-${LITESTREAM_VERSION}-linux-amd64.tar.gz" \
-O /tmp/litestream.tar.gz \
&& tar -xzf /tmp/litestream.tar.gz -C /usr/local/bin \
&& rm /tmp/litestream.tar.gz
COPY --from=builder /app/target/release/mum /usr/local/bin/mum
COPY litestream.yml /etc/litestream.yml
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENV MUM_ADDR=0.0.0.0:8080
ENV MUM_DB=/data/mum-server.db
EXPOSE 8080
ENTRYPOINT ["docker-entrypoint.sh"]