-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (34 loc) · 1.21 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (34 loc) · 1.21 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
# ----------------- default (start) -----------------------
FROM node:22.16.0 AS default
EXPOSE 4321 35729
ENV NPM_CONFIG_PREFIX=/usr/app/.npm-global \
PATH=$PATH:/usr/app/.npm-global/bin
VOLUME /usr/app/spfx
WORKDIR /usr/app/spfx
RUN useradd --create-home --shell /bin/bash spfx && \
usermod -aG sudo spfx && \
chown -R spfx:spfx /usr/app
USER spfx
RUN npm i --location=global yo pnpm @rushstack/heft
RUN npm i --location=global @microsoft/generator-sharepoint@1.23.0
CMD /bin/bash
# ----------------- default (end) ---------------------------
# ----------------- test-base (start) -----------------------
FROM default AS test-base
RUN mkdir -p test/.pnpm-store
WORKDIR test
# ----------------- test-base (end) -----------------------
# ----------------- test-webpart (start) ------------------
FROM test-base AS test-webpart
RUN yo @microsoft/sharepoint --component-type webpart \
--solution-name spfx-webpart \
--component-name HelloWorld \
--framework react \
--package-manager pnpm \
--skip-install
WORKDIR spfx-webpart
RUN --mount=type=cache,target=/usr/app/spfx/test/.pnpm-store,sharing=locked \
pnpm install
RUN pnpm build
WORKDIR ..
# ----------------- test-webpart (end) ------------------