Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/SantaClaas/chat-fww. Chat app project for frameworks and workflows and w...?
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# Build the client SPAFROM node:21 AS build-clientWORKDIR /client
# Installs pnpm as it is set as package manager in package.jsonRUN corepack enable
# Copy over manifestsCOPY ./client/package.json ./package.jsonCOPY ./client/pnpm-lock.yaml ./pnpm-lock.yaml
# Install dependenciesRUN pnpm install
# Copy over the source to build the applicationCOPY ./client ./
# Build and cacheRUN pnpm run build
# Build the server containing the API and hosting the clientFROM rust:1.79 AS build-server
# Create a new empty shell projectRUN USER=root cargo new --bin serverWORKDIR /server
# Copy over manifests# The lock file is in the workspace root. Should probably use the workspace Cargo.toml too but this works so farCOPY ./Cargo.lock ./Cargo.lockCOPY ./server/Cargo.toml ./Cargo.toml
# Install serialport crate dependenciesRUN apt-get update && apt-get install -y libudev-dev
# Build and cache the dependenciesRUN cargo build --releaseRUN rm src/*.rs
# Copy over the source to build the applicationCOPY ./server/src ./src
# Build the applicationRUN rm ./target/release/deps/server*RUN cargo build --release
# Final base imageFROM debian:bookworm-slim AS final
# Copy the build artifacts from the build stageCOPY --from=build-server /server/target/release/server .# The ./client directory is where the server looks for when client static files are requestedCOPY --from=build-client /client/dist ./client
EXPOSE 3000# Set the startup command to run the applicationCMD ["./server"]