feat: Containerize frontend and backend services with Docker and Docker Compose, enabling environment-based API configuration.

This commit is contained in:
2025-12-23 03:34:48 +01:00
parent c441f14bfa
commit cb0ac687ca
7 changed files with 127 additions and 8 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM rust:1.92 AS builder
WORKDIR /app
COPY . .
# Build the release binary
RUN cargo build --release -p notes-api
FROM debian:bookworm-slim
WORKDIR /app
# Install OpenSSL (required for many Rust networking crates) and CA certificates
RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/notes-api .
# Create data directory for SQLite
RUN mkdir -p /app/data
ENV DATABASE_URL=sqlite:///app/data/notes.db
ENV SESSION_SECRET=supersecretchangeinproduction
EXPOSE 3000
CMD ["./notes-api"]