Skip to content

Commit

Permalink
fix dockerfile for app in multi stange container
Browse files Browse the repository at this point in the history
  • Loading branch information
vmleon committed Aug 28, 2024
1 parent 6410904 commit c27227c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
FROM nginx:1.23-alpine-slim
FROM --platform=linux/amd64 node:18-slim AS builder

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

WORKDIR /usr/share/build
RUN mkdir -p ./src \
&& mkdir -p ./scripts \
&& mkdir -p ./staged-themes

RUN mkdir -p /usr/share/build/src \
&& mkdir -p /usr/share/build/scripts
COPY src/ ./src/
COPY staged-themes/ ./staged-themes
COPY scripts/ ./scripts/
COPY *.json ./

COPY src/ /usr/share/build/src/

COPY scripts/ /usr/share/build/scripts/

COPY *.json /usr/share/build/
RUN rm package-lock.json

RUN npm install -g @oracle/[email protected]
RUN npm install
RUN npm install -g @oracle/ojet-cli
RUN ojet build web --release
RUN ojet build web --release

FROM --platform=linux/amd64 nginx:1.23-alpine-slim

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

EXPOSE 80

Expand Down
1 change: 1 addition & 0 deletions deploy/k8s/app/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
spec:
containers:
- image: app
imagePullPolicy: "Always"
name: app
readinessProbe:
httpGet:
Expand Down

0 comments on commit c27227c

Please sign in to comment.