Skip to content

Commit

Permalink
DBZ-7447: Docker image update (#851)
Browse files Browse the repository at this point in the history
Co-authored-by: Indra Shukla <[email protected]>
  • Loading branch information
indraraj and Indra Shukla committed Feb 9, 2024
1 parent dc5ad3d commit 35e1909
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
33 changes: 9 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
####
# This Dockerfile is used in order to build a container with Debezium UI.
###

FROM registry.access.redhat.com/ubi9/nodejs-18

# Set the working directory inside the container
# Build UI
FROM registry.access.redhat.com/ubi9/nodejs-18 AS build
WORKDIR /app

# Copy package.json and package-lock.json (or yarn.lock) to the working directory
COPY --chown=1001 package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code to the working directory
COPY --chown=1001 . .
RUN npm run build

# Final image with only build artifacts
FROM node:18-slim
WORKDIR /app
RUN npm install express
COPY --from=build /app/dist/serve.js /app/dist/config.js ./
COPY --from=build /app/dist ./dist
EXPOSE 3000

# Set the environment variable NODE_ENV to "production"
ENV NODE_ENV=production

# Set the environment variable KAFKA_CONNECT_CLUSTERS
ENV KAFKA_CONNECT_CLUSTERS=http://localhost:8083/

# Build the React application
RUN npm run build

# Install a lightweight web server
# RUN npm install -g serve

# Set the command to start the web server and serve the built application
CMD ["node", "serve"]

# CMD ["npm", "run", "start:dev"]
3 changes: 3 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ module.exports = (env) => {
new CopyPlugin({
patterns: [{ from: './config.js', to: './' }],
}),
new CopyPlugin({
patterns: [{ from: './serve.js', to: './' }],
}),
],
resolve: {
extensions: ['.js', '.ts', '.tsx', '.jsx'],
Expand Down

0 comments on commit 35e1909

Please sign in to comment.