Skip to content

Commit 87e9fbc

Browse files
committed
build(Docker): update dockerfile to build frontend first in separate stage and update readme to include build badge
1 parent c9f9c0f commit 87e9fbc

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

Dockerfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
1+
# Build the frontend
2+
FROM node:24-alpine AS frontend-builder
3+
4+
WORKDIR /app/web/clef
5+
6+
# Copy package files
7+
COPY web/clef/package*.json ./
8+
9+
# Install dependencies
10+
RUN npm ci
11+
12+
# Copy frontend source code
13+
COPY web/clef/ ./
14+
15+
# Build the frontend
16+
RUN npm run build
17+
118
# Build stage
219
FROM rust:1.88-alpine AS builder
320

421
RUN apk add --no-cache musl-dev sqlite-dev sqlite-static openssl-dev openssl-libs-static
522

6-
723
WORKDIR /app
24+
825
COPY Cargo.toml Cargo.lock ./
926
COPY src ./src
1027
COPY diesel.toml ./
1128
COPY migrations/ ./migrations/
1229

30+
COPY --from=frontend-builder /app/web/clef/dist/ ./web/clef/dist/
31+
1332
# Build the application
1433
RUN cargo build --release
1534

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> Unlock private NPM registry, sealed in Rust.
44
5+
[![API](https://github.com/jkuri/clef/actions/workflows/clef.yml/badge.svg)](https://github.com/jkuri/clef/actions/workflows/clef.yml)
6+
57
A high-performance private npm registry built with Rust and Rocket. Clef provides secure package hosting with intelligent upstream proxying, authentication, and caching—delivering the reliability and speed your development workflow demands.
68

79
## Features

0 commit comments

Comments
 (0)