m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-08 05:03:49 -05:00
Files
cup/Dockerfile
2025-03-21 18:36:52 +02:00

44 lines
630 B
Docker

### Build UI ###
FROM node:20 AS web
# Install bun
RUN curl -fsSL https://bun.sh/install | bash
# Copy web folder
COPY ./web /web
WORKDIR /web
# Install requirements
RUN ~/.bun/bin/bun install
# Build frontend
RUN ~/.bun/bin/bun run build
### Build Cup ###
FROM rust:1-alpine AS build
# Requirements
RUN apk add musl-dev
# Copy files
WORKDIR /cup
COPY Cargo.toml .
COPY Cargo.lock .
COPY ./src ./src
# Copy UI from web builder
COPY --from=web /web/dist src/static
# Build
RUN cargo build --release
### Main ###
FROM scratch
# Copy binary
COPY --from=build /cup/target/release/cup /cup
EXPOSE 8000
ENTRYPOINT ["/cup"]