-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.web
More file actions
30 lines (29 loc) · 1.49 KB
/
Copy pathDockerfile.web
File metadata and controls
30 lines (29 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Builds the web SPA (npm run web:build → dist/web) and serves it via nginx.
# Independent of electron-builder.json / the electron-builder.json build:
# this image never touches electron/**, backend/**, or the Electron scripts.
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
COPY packages ./packages
RUN npm ci
# @omnibioai/ui is a file: dependency consumed as prebuilt dist/ output
# (its package.json main/module/css all point into dist/). .dockerignore
# excludes **/dist from the build context, so unlike a host checkout where
# dist/ was already built once, the copied packages/omnibioai-ui here has
# none — it has to be built explicitly or `npm run web:build` fails to
# resolve "@omnibioai/ui/dist/index.css" from src/ui/main.jsx.
# @omnibioai/design-tokens needs no such step — it ships plain source files
# (tokens.css/.js/.ts) directly, per its package.json.
# npm ci here fails: packages/omnibioai-ui/package-lock.json is out of sync
# with its own package.json (missing the @omnibioai/design-tokens entry) —
# a pre-existing issue in that package (it has its own repo, see its
# package.json "repository" field), not something to hand-patch in a
# vendored lockfile from here. `npm install` reconciles it instead of
# failing strict the way `ci` does.
RUN cd packages/omnibioai-ui && npm install && npm run build
COPY . .
RUN npm run web:build
FROM nginx:alpine
COPY --from=builder /app/dist/web /usr/share/nginx/html
COPY docker/nginx-web.conf /etc/nginx/conf.d/default.conf
EXPOSE 80