diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..ebd2b23 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,31 @@ +FROM rust:1.85-bookworm AS build + +WORKDIR /app + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + pkg-config \ + libsqlite3-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY Cargo.toml Cargo.lock ./ +COPY src ./src +COPY migrations ./migrations + +RUN cargo build --release + +FROM debian:bookworm-slim + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + libsqlite3-0 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY --from=build /app/target/release/backend /app/backend + +EXPOSE 3000 + +CMD ["/app/backend"] diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..a13bbd6 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,15 @@ +FROM node:20-alpine AS build + +WORKDIR /app + +COPY package.json bun.lock ./ +RUN npm install -g bun && bun install + +COPY . . +RUN bun run build + +FROM nginx:1.27-alpine + +COPY --from=build /app/dist /usr/share/nginx/html + +EXPOSE 80