normogen/backend/docker/Dockerfile.dev
goose b3d5304bf6
Some checks failed
Lint and Build / Lint (push) Failing after 5s
Lint and Build / Build (push) Has been skipped
Lint and Build / Docker Build (push) Has been skipped
fix: Disable output buffering in Docker to show startup logs
2026-02-20 16:57:13 -03:00

31 lines
769 B
Text

# Development Dockerfile
# Uses Rust 1.93+ to support Edition 2024 dependencies
FROM rust:1.93-slim
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy Cargo files first for better caching
COPY Cargo.toml ./
# Create dummy main.rs for dependency caching
RUN mkdir src && echo 'fn main() {}' > src/main.rs
# Build dependencies (this layer will be cached)
RUN cargo build && rm -rf src
# Copy actual source code
COPY src ./src
# Expose port
EXPOSE 8000
# Run the application with unbuffered output
# PYTHONUNBUFFERED=1 and stdio -u flag for Python compatibility
# RUST_BACKTRACE=1 for better error messages
CMD ["sh", "-c", "RUST_BACKTRACE=1 cargo run"]