Skip to content

Commit d543234

Browse files
authored
Merge pull request #28 from oracle-devrel/fix-app-dockerfile
fix dockerfile for app in multi stange container
2 parents 6410904 + c27227c commit d543234

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

app/Dockerfile

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
FROM nginx:1.23-alpine-slim
1+
FROM --platform=linux/amd64 node:18-slim AS builder
22

3-
RUN apk add --update nodejs npm
3+
WORKDIR /usr/src/app
44

5-
WORKDIR /usr/share/build
5+
RUN mkdir -p ./src \
6+
&& mkdir -p ./scripts \
7+
&& mkdir -p ./staged-themes
68

7-
RUN mkdir -p /usr/share/build/src \
8-
&& mkdir -p /usr/share/build/scripts
9+
COPY src/ ./src/
10+
COPY staged-themes/ ./staged-themes
11+
COPY scripts/ ./scripts/
12+
COPY *.json ./
913

10-
COPY src/ /usr/share/build/src/
11-
12-
COPY scripts/ /usr/share/build/scripts/
13-
14-
COPY *.json /usr/share/build/
14+
RUN rm package-lock.json
1515

16+
RUN npm install -g @oracle/[email protected]
1617
RUN npm install
17-
RUN npm install -g @oracle/ojet-cli
18-
RUN ojet build web --release
18+
RUN ojet build web --release
19+
20+
FROM --platform=linux/amd64 nginx:1.23-alpine-slim
1921

20-
RUN cp -R /usr/share/build/web/* /usr/share/nginx/html/
22+
COPY --from=builder /usr/src/app/web/* /usr/share/nginx/html/
2123

2224
EXPOSE 80
2325

deploy/k8s/app/app.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ spec:
2121
spec:
2222
containers:
2323
- image: app
24+
imagePullPolicy: "Always"
2425
name: app
2526
readinessProbe:
2627
httpGet:

0 commit comments

Comments
 (0)