Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dockerfile for app in multi stange container #28

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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