Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 35e1909

Browse files
indrarajIndra Shukla
andauthored
DBZ-7447: Docker image update (#851)
Co-authored-by: Indra Shukla <indrashukla@Indras-MacBook-Air.local>
1 parent dc5ad3d commit 35e1909

File tree

2 files changed

+12
-24
lines changed

2 files changed

+12
-24
lines changed

Dockerfile

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
11
####
22
# This Dockerfile is used in order to build a container with Debezium UI.
33
###
4-
5-
FROM registry.access.redhat.com/ubi9/nodejs-18
6-
7-
# Set the working directory inside the container
4+
# Build UI
5+
FROM registry.access.redhat.com/ubi9/nodejs-18 AS build
86
WORKDIR /app
9-
10-
# Copy package.json and package-lock.json (or yarn.lock) to the working directory
117
COPY --chown=1001 package*.json ./
12-
13-
# Install dependencies
148
RUN npm install
15-
16-
# Copy the rest of the application code to the working directory
179
COPY --chown=1001 . .
10+
RUN npm run build
1811

12+
# Final image with only build artifacts
13+
FROM node:18-slim
14+
WORKDIR /app
15+
RUN npm install express
16+
COPY --from=build /app/dist/serve.js /app/dist/config.js ./
17+
COPY --from=build /app/dist ./dist
1918
EXPOSE 3000
20-
21-
# Set the environment variable NODE_ENV to "production"
2219
ENV NODE_ENV=production
23-
24-
# Set the environment variable KAFKA_CONNECT_CLUSTERS
2520
ENV KAFKA_CONNECT_CLUSTERS=http://localhost:8083/
26-
27-
# Build the React application
28-
RUN npm run build
29-
30-
# Install a lightweight web server
31-
# RUN npm install -g serve
32-
33-
# Set the command to start the web server and serve the built application
3421
CMD ["node", "serve"]
35-
36-
# CMD ["npm", "run", "start:dev"]

webpack.common.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ module.exports = (env) => {
142142
new CopyPlugin({
143143
patterns: [{ from: './config.js', to: './' }],
144144
}),
145+
new CopyPlugin({
146+
patterns: [{ from: './serve.js', to: './' }],
147+
}),
145148
],
146149
resolve: {
147150
extensions: ['.js', '.ts', '.tsx', '.jsx'],

0 commit comments

Comments
 (0)