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-UpdateCodebase: Update with new codebase. #817

Merged
merged 1 commit into from
Dec 7, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 20 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
.idea/
.github/
oc-demo/
# Ignore node_modules directory
node_modules/

# Ignore build artifacts
build/
dist/

# Ignore development files
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Ignore npm cache
.npm

# Ignore log files
*.log
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# KAFKA_CONNECT_CLUSTERS=http://localhost:8083/,http://localhost:8084/,http://localhost:8085/
#ENV_2=http://2.myendpoint.com
44 changes: 15 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
activemq-data/
.idea/
*.iml
*.ipr
*.iws
node_modules/
.metadata/
.mvn/
.recommenders/
.classpath
.project
.cache
.settings/
.factorypath
.checkstyle
.gradle/
.vscode/
build/
deploy/
target/
mods/
*.swp
epom
log
npm-debug.log
*.log
.DS_Store
phantomjsdriver.log
node_modules
dist

.idea
.vscode

yarn.lock
generated-sources/
!/yarn.lock

.yalc
yalc.lock

cypress/videos
cypress/screenshots

/state/
bin/
storybook-static
117 changes: 0 additions & 117 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

2 changes: 0 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

88 changes: 22 additions & 66 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,77 +1,33 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 AS builder
# Use the official Node.js image as the base image
FROM node:18

ARG JAVA_PACKAGE=java-11-openjdk-headless
# Set the working directory inside the container
WORKDIR /app

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
ENV JAVA_HOME="/usr/lib/jvm/jre-11"
ENV NPM_CONFIG_CACHE="/.cache/npm"
# Copy package.json and package-lock.json (or yarn.lock) to the working directory
COPY package*.json ./

RUN microdnf install ca-certificates ${JAVA_PACKAGE} java-11-openjdk-devel tzdata-java git \
&& microdnf update \
&& microdnf clean all \
&& mkdir -p /javabuild/backend \
&& mkdir -p /javabuild/ui \
&& chown -R 1001 /javabuild \
&& chmod -R "g+rwX" /javabuild \
&& chown -R 1001:root /javabuild \
&& mkdir -p /.cache \
&& chown -R 1001 /.cache \
&& chmod -R "g+rwX" /.cache \
&& chown -R 1001:root /.cache \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
# Install dependencies
RUN npm install

USER 1001
# Copy the rest of the application code to the working directory
COPY . .

COPY --chown=1001:root mvnw /javabuild/mvnw
COPY --chown=1001:root .mvn/ /javabuild/.mvn/
COPY --chown=1001:root pom.xml /javabuild/
COPY --chown=1001:root backend/pom.xml /javabuild/backend/pom.xml
COPY --chown=1001:root ui/pom.xml /javabuild/ui/pom.xml
EXPOSE 3000

WORKDIR /javabuild
# Set the environment variable NODE_ENV to "production"
ENV NODE_ENV=production

RUN ./mvnw clean dependency:go-offline -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
# Set the environment variable KAFKA_CONNECT_CLUSTERS
ENV KAFKA_CONNECT_CLUSTERS=http://localhost:8085/

COPY --chown=1001:root . /javabuild/
# Build the React application
RUN npm run build

RUN ./mvnw package -am -pl backend -Dquarkus.package.type=fast-jar -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
# Install a lightweight web server
# RUN npm install -g serve

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
# Set the command to start the web server and serve the built application
CMD ["node", "serve"]

ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
ENV JAVA_HOME="/usr/lib/jvm/jre-11"

# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} tzdata-java \
&& microdnf update \
&& microdnf clean all \
&& mkdir /deployments \
&& chown 1001 /deployments \
&& chmod "g+rwX" /deployments \
&& chown 1001:root /deployments \
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
&& chown 1001 /deployments/run-java.sh \
&& chmod 540 /deployments/run-java.sh \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security

# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

# We make four distinct layers so if there are application changes the library layers can be re-used
COPY --from=builder --chown=1001 /javabuild/backend/target/quarkus-app/lib/ /deployments/lib/
COPY --from=builder --chown=1001 /javabuild/backend/target/quarkus-app/*.jar /deployments/
COPY --from=builder --chown=1001 /javabuild/backend/target/quarkus-app/app/ /deployments/app/
COPY --from=builder --chown=1001 /javabuild/backend/target/quarkus-app/quarkus/ /deployments/quarkus/

# We explicitly remove the Oracle OJDBC8 dependency from the base image.
# The Dockerfile.oracle leaves this in place for the time being for test.
RUN rm -f /deployments/lib/main/ojdbc8*.jar

EXPOSE 8080
USER 1001

ENTRYPOINT [ "/deployments/run-java.sh" ]
# CMD ["npm", "run", "start:dev"]
73 changes: 0 additions & 73 deletions Dockerfile.oracle

This file was deleted.

Loading
Loading