-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.demo
31 lines (22 loc) · 837 Bytes
/
Dockerfile.demo
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
FROM rust:latest as builder
# Install cargo-binstall
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# Add Cargo.toml
COPY Cargo.toml CHANGELOG.md ./
# Install pre-built taxy
RUN cargo binstall -y taxy
# Prepare the final image
FROM debian:bookworm-slim as runtime
# Install dependencies for the Rust binary
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy the Rust binary from the builder stage
COPY --from=builder /usr/local/cargo/bin/taxy .
# Add admin user
RUN ./taxy add-user admin -p admin
# Set the entrypoint to run the Rust binary
ENTRYPOINT ["./taxy", "start", "--webui", "0.0.0.0:8080"]