Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (38 loc) · 1.83 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (38 loc) · 1.83 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
# ---------------------------------------------------------------------------
# Stage 1 — build catalog.json from the live Yundera/AppStore
# ---------------------------------------------------------------------------
FROM node:20-alpine AS catalog
WORKDIR /build
RUN apk add --no-cache git
COPY package.json ./
RUN npm install --no-audit --no-fund
COPY scripts ./scripts
COPY config ./config
COPY docs ./docs
# Shallow clone the store, then sync → /build/public/catalog.json
RUN git clone --depth 1 https://github.com/Yundera/AppStore appstore \
&& node scripts/sync-catalog.mjs \
--store ./appstore \
--overlay config/apps-overlay.json \
--tags config/tags.json \
--docs ./docs \
--out public/catalog.json
# ---------------------------------------------------------------------------
# Stage 2 — static site served by nginx (fully self-contained, no runtime net)
# ---------------------------------------------------------------------------
FROM nginx:1.27-alpine
COPY src/nginx.conf /etc/nginx/conf.d/default.conf
# Static assets: index.html, guide.html, css/, js/
COPY src/ /usr/share/nginx/html/
RUN rm -f /usr/share/nginx/html/nginx.conf
# Boot script — writes runtime.json from env vars before nginx starts.
COPY src/docker-entrypoint.d/10-runtime-json.sh /docker-entrypoint.d/10-runtime-json.sh
RUN chmod +x /docker-entrypoint.d/10-runtime-json.sh \
&& rm -rf /usr/share/nginx/html/docker-entrypoint.d
# Markdown docs (served locally at /docs)
COPY docs/ /usr/share/nginx/html/docs/
# Runtime config the app fetches (onboarding, tags, site, install-tutorial)
COPY config/onboarding.json config/tags.json config/site.json config/install-tutorial.json /usr/share/nginx/html/config/
# Generated catalog baked in from stage 1
COPY --from=catalog /build/public/catalog.json /usr/share/nginx/html/catalog.json
EXPOSE 80