-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
41 lines (31 loc) · 1.01 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
# Use the official Rust image as the base image for the builder stage
FROM rust:latest as builder
# Install trunk
RUN cargo install trunk
RUN rustup target add wasm32-unknown-unknown
# Set the working directory
WORKDIR /usr/src/app
# Copy the actual source code
COPY Cargo.toml Cargo.lock ./
COPY taxy taxy
COPY taxy-api taxy-api
COPY taxy-webui taxy-webui
# Build the web UI
WORKDIR /usr/src/app/taxy-webui
RUN trunk build --cargo-profile web-release --release
WORKDIR /usr/src/app
# Build the Rust project
RUN cargo build --release
# 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/src/app/target/release/taxy /usr/bin
# Set the entrypoint to run the Rust binary
ENTRYPOINT ["taxy", "start", "--webui", "0.0.0.0:46492"]