# Dockerfile for running tests
FROM rust:1.93-slim
# Install dependencies for building and testing
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
libpq-dev \
postgresql-client \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install SeaORM CLI for migrations
RUN cargo install sea-orm-cli
# Create app directory
WORKDIR /app
# Copy project files
COPY Cargo.toml Cargo.lock ./
COPY src ./src
COPY tests ./tests
COPY migrations ./migrations
# Pre-build dependencies (cache layer)
RUN cargo build --tests
# Default command (can be overridden)
CMD ["cargo", "test"]