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

DBZ-8606: Add dockerfile for stage snapshot image #421

Merged
merged 4 commits into from
Feb 1, 2025
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
1 change: 1 addition & 0 deletions build-debezium-multiplatform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ build_docker_image operator
build_docker_image platform-conductor
if [[ "$SKIP_UI" != "true" ]]; then
build_docker_image debezium-ui ui
build_docker_image platform-stage
fi
build_docker_image example-mysql examples/mysql
build_docker_image example-mysql-gtids examples/mysql-gtids
Expand Down
1 change: 1 addition & 0 deletions build-debezium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ build_docker_image platform-conductor
build_docker_image operator
if [[ "$SKIP_UI" != "true" ]]; then
build_docker_image debezium-ui ui
build_docker_image platform-stage
fi

echo ""
Expand Down
44 changes: 44 additions & 0 deletions platform-stage/3.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
####
# This Dockerfile is used in order to build a container with Debezium platform UI.
###
ARG VERSION=main

# Clone the repository
FROM registry.access.redhat.com/ubi9/ubi-minimal AS cloner
ARG VERSION
WORKDIR /app
RUN microdnf install -y git && \
git clone https://github.com/debezium/debezium-platform.git && \
cd debezium-platform && \
git checkout ${VERSION} && \
cd debezium-platform-stage

# Build the application
FROM registry.access.redhat.com/ubi9/nodejs-20 AS builder
USER root
RUN mkdir -p /app && chown 1001:1001 /app
USER 1001
RUN npm install -g yarn

WORKDIR /app
COPY --from=cloner /app/debezium-platform/debezium-platform-stage/package.json /app/
COPY --from=cloner /app/debezium-platform/debezium-platform-stage/yarn.lock /app/
RUN yarn install

COPY --from=cloner /app/debezium-platform/debezium-platform-stage /app
RUN yarn build

# Final image
FROM mirror.gcr.io/library/node:20-alpine
RUN yarn global add serve

WORKDIR /app
COPY --from=builder /app/dist /app/dist
COPY --from=cloner /app/debezium-platform/debezium-platform-stage/inject-env.sh /inject-env.sh
RUN chmod +x /inject-env.sh

LABEL maintainer="Debezium Community" \
description="Debezium Platform Stage UI"

EXPOSE 3000
CMD ["/inject-env.sh"]
44 changes: 44 additions & 0 deletions platform-stage/snapshot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
####
# This Dockerfile is used in order to build a container with Debezium platform UI.
###
ARG VERSION=main

# Clone the repository
FROM registry.access.redhat.com/ubi9/ubi-minimal AS cloner
ARG VERSION
WORKDIR /app
RUN microdnf install -y git && \
git clone https://github.com/debezium/debezium-platform.git && \
cd debezium-platform && \
git checkout ${VERSION} && \
cd debezium-platform-stage

# Build the application
FROM registry.access.redhat.com/ubi9/nodejs-20 AS builder
USER root
RUN mkdir -p /app && chown 1001:1001 /app
USER 1001
RUN npm install -g yarn

WORKDIR /app
COPY --from=cloner /app/debezium-platform/debezium-platform-stage/package.json /app/
COPY --from=cloner /app/debezium-platform/debezium-platform-stage/yarn.lock /app/
RUN yarn install

COPY --from=cloner /app/debezium-platform/debezium-platform-stage /app
RUN yarn build

# Final image
FROM mirror.gcr.io/library/node:20-alpine
RUN yarn global add serve

WORKDIR /app
COPY --from=builder /app/dist /app/dist
COPY --from=cloner /app/debezium-platform/debezium-platform-stage/inject-env.sh /inject-env.sh
RUN chmod +x /inject-env.sh

LABEL maintainer="Debezium Community" \
description="Debezium Platform Stage UI"

EXPOSE 3000
CMD ["/inject-env.sh"]