-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ohif
More file actions
61 lines (45 loc) · 2.57 KB
/
Dockerfile.ohif
File metadata and controls
61 lines (45 loc) · 2.57 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# syntax=docker/dockerfile:1
# =============================================================================
# AmbientCT — Custom OHIF Build with Dental Extensions
# =============================================================================
# Stage 1: Clone OHIF v3.9.2, copy extensions, register, build
# Stage 2: Serve dist/ with nginx
# =============================================================================
# ── Stage 1: Build ────────────────────────────────────────────────────────────
FROM node:22-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN corepack enable
# Clone OHIF at the exact version AmbientCT targets
RUN git clone --depth 1 --branch v3.9.2 \
https://github.com/OHIF/Viewers.git /ohif
WORKDIR /ohif
# Copy AmbientCT extensions into the OHIF monorepo workspace
COPY extensions/dental-cpr/ extensions/dental-cpr/
COPY extensions/dental-tools/ extensions/dental-tools/
COPY modes/dental-cpr-mode/ modes/dental-cpr-mode/
# Copy registration + compile scripts (cwd = WORKDIR = /ohif when run)
COPY scripts/ohif/register-packages.js /tmp/register-packages.js
COPY scripts/ohif/register-plugins.js /tmp/register-plugins.js
COPY scripts/ohif/compile-extensions.js /tmp/compile-extensions.js
# Register extensions as workspace dependencies in platform/app/package.json
RUN node /tmp/register-packages.js
# Register extensions in pluginConfig.json (official OHIF v3 extension list)
RUN node /tmp/register-plugins.js
# Install all workspace dependencies
RUN yarn install
# Pre-compile JSX/TSX → plain JS using @babel/core from OHIF's node_modules.
# Required because OHIF's webpack babel-loader does not transpile workspace packages.
RUN node /tmp/compile-extensions.js
# Build OHIF (outputs to platform/app/dist)
RUN yarn workspace @ohif/app run build
# ── Stage 2: Serve ────────────────────────────────────────────────────────────
FROM nginx:alpine
COPY --from=builder /ohif/platform/app/dist /usr/share/nginx/html
COPY config/nginx/ohif.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
LABEL org.opencontainers.image.title="AmbientCT OHIF + Dental Extensions"
LABEL org.opencontainers.image.source="https://github.com/Ambientwork/AmbientCT"
LABEL org.opencontainers.image.version="0.2.0"
LABEL org.opencontainers.image.licenses="MIT"