feat: docker file

This commit is contained in:
Elias Renman
2025-03-25 15:33:49 +01:00
parent 7706cb96c4
commit 8ba644f3c0
6 changed files with 78 additions and 6 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Stage 1: Build the frontend assets using Bun
FROM oven/bun:1-alpine AS bun-builder
# Set the working directory
WORKDIR /app/web
# Copy the frontend source code
COPY ./web ./
# Install dependencies and build the frontend
RUN bun install --frozen-lockfile && bun run build
# Build binaries
FROM rust:slim
RUN apt update && \
apt install -y libsqlite3-dev
COPY --from=bun-builder /app/web/dist ./web/dist
WORKDIR /app
COPY . .
RUN cargo build --release
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8000
EXPOSE 8000
CMD [ "cargo", "run", "--release" ]