Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 13 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1.1.45-alpine AS base
# Use the latest LTS version of Node.js
# https://hub.docker.com/_/node
FROM node:22-alpine3.20 AS build-stage
WORKDIR /usr/src/app

# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
# Copy package.json and package-lock.json
COPY package*.json ./

# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
# Install dependencies
RUN npm ci

# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM base AS build-stage
COPY --from=install /temp/dev/node_modules node_modules
COPY . .

# [optional] tests & build
# Build
ENV NODE_ENV=production
COPY . .
RUN npm run build

RUN bun run build

FROM nginx:1.27.3-alpine-slim
# Use the latest LTS version of Nginx as the serving image
# https://hub.docker.com/_/nginx
FROM nginx:1.27.4-alpine-slim

COPY nginx.conf /etc/nginx/templates/default.conf.template
COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UI frontend for @openmcp-project

### Development

1. install dependencies (can also use npm): `bun i`
1. install dependencies: `npm i`

1. Copy the `frontend-config.json` to `public/frontend-config.json` and adapt the `backendUrl` according to your setup (see section Dynamic Frontend Config).

Expand All @@ -20,17 +20,17 @@ UI frontend for @openmcp-project

1. Start the application:

Run `bun run dev`
Run `npm run dev`

### Build

1. Build the application:

Run `bun run build`
Run `npm run build`

2. Serve the application locally:

Run `bun run preview`
Run `npm run preview`

3. For production:

Expand Down
Loading