init
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM node:latest AS frontend-builder
|
||||
WORKDIR /app
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm install
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM rust:1.87-slim AS backend-builder
|
||||
WORKDIR /app
|
||||
RUN apt-get update && \
|
||||
apt-get install -y pkg-config libssl-dev build-essential ca-certificates
|
||||
|
||||
COPY src/ src/
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y ca-certificates openssl && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=backend-builder /app/target/release/rick-and-morty .
|
||||
COPY --from=frontend-builder /app/dist ./frontend/dist
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["./rick-and-morty"]
|
Reference in New Issue
Block a user