feat: add Dockerfile
All checks were successful
Build and Test / splatie (push) Successful in 4m11s

This commit is contained in:
kittentm 2026-06-14 22:29:59 +02:00
commit ec8016cc36
Signed by: kitten
GPG key ID: 394B4EABE4405A83

37
Dockerfile Normal file
View file

@ -0,0 +1,37 @@
# syntax=docker/dockerfile:1
FROM rust:alpine AS chef
RUN apk add --no-cache openssl-dev musl-dev openssl-libs-static lld git g++ make cmake
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
ENV OPENSSL_LIB_DIR=/usr/lib
ENV OPENSSL_INCLUDE_DIR=/usr/include/openssl
ENV OPENSSL_STATIC=1
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo chef cook --release --recipe-path recipe.json --target x86_64-unknown-linux-musl
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release --target x86_64-unknown-linux-musl && \
mkdir -p /app/dist && \
cp /app/target/x86_64-unknown-linux-musl/release/tagaya /app/dist/
FROM alpine:latest AS final
WORKDIR /app
COPY --from=builder /app/dist/tagaya ./tagaya
EXPOSE 3000
ENTRYPOINT ["./tagaya"]