first commit
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# Build Frontend
|
||||
FROM rust:latest as frontend-builder
|
||||
WORKDIR /app
|
||||
COPY frontend ./frontend
|
||||
COPY backend/static ./backend/static
|
||||
# Install wasm-pack
|
||||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
WORKDIR /app/frontend
|
||||
# Build frontend
|
||||
RUN wasm-pack build --target web --out-name wasm --out-dir ../backend/static
|
||||
|
||||
# Build Backend
|
||||
FROM rust:latest as backend-builder
|
||||
WORKDIR /app
|
||||
COPY backend ./backend
|
||||
COPY --from=frontend-builder /app/backend/static ./backend/static
|
||||
WORKDIR /app/backend
|
||||
RUN cargo build --release
|
||||
|
||||
# Runtime
|
||||
FROM debian:bookworm-slim
|
||||
WORKDIR /app
|
||||
COPY --from=backend-builder /app/backend/target/release/backend ./backend
|
||||
COPY --from=frontend-builder /app/backend/static ./static
|
||||
# Install ca-certificates for HTTPS if needed
|
||||
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV SCYLLA_URI=scylla:9042
|
||||
EXPOSE 3000
|
||||
CMD ["./backend"]
|
||||
Reference in New Issue
Block a user