Skip to content

Commit

Permalink
Reverted footer changes. Improved the Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
densbornp committed Aug 31, 2024
1 parent 49da313 commit 8590433
Show file tree
Hide file tree
Showing 15 changed files with 1,226 additions and 847 deletions.
77 changes: 52 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
FROM ubuntu:22.04
# Install NodeJs and Java
RUN apt-get update && apt-get install curl -y && apt-get clean && curl -fsSL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
RUN bash /tmp/nodesource_setup.sh
RUN apt-get update && apt-get install nodejs openjdk-11-jdk wget -y && apt-get clean
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
# Add Maven dependencies
ENV MAVEN_VERSION 3.9.6
ENV MAVEN_HOME /usr/lib/mvn
ENV PATH $MAVEN_HOME/bin:$PATH
RUN wget http://archive.apache.org/dist/maven/maven-3/"$MAVEN_VERSION"/binaries/apache-maven-"$MAVEN_VERSION"-bin.tar.gz && \
tar -zxvf apache-maven-"$MAVEN_VERSION"-bin.tar.gz && \
rm apache-maven-"$MAVEN_VERSION"-bin.tar.gz && \
mv apache-maven-"$MAVEN_VERSION" /usr/lib/mvn
# Create directory for the app
RUN mkdir /opt/ghostface
COPY . /opt/ghostface
WORKDIR /opt/ghostface/frontend
RUN npm install -g @angular/cli && npm install && npm run build
WORKDIR /opt/ghostface
RUN mvn clean install
WORKDIR /opt/ghostface/backend
# Clean mvnw file from spaces and CR characters
RUN sed -i 's/\r$//' mvnw
# Use a more specific base image
FROM eclipse-temurin:17-jdk-jammy AS build

# Install Node.js and npm
RUN apt-get update && apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set up Maven
ENV MAVEN_VERSION=3.9.9
ENV MAVEN_HOME=/usr/share/maven
ENV PATH=${MAVEN_HOME}/bin:${PATH}
RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
| tar xzf - -C /usr/share \
&& mv /usr/share/apache-maven-${MAVEN_VERSION} ${MAVEN_HOME} \
&& ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn

# Set working directory
WORKDIR /app

# Copy source code
COPY . .

# Install dependencies and build frontend
WORKDIR /app/frontend
RUN npm ci && \
npm run build

# Build backend
WORKDIR /app/backend
RUN ./mvnw package -DskipTests

# Final stage
FROM eclipse-temurin:17-jre-jammy

# Copy built artifacts from the build stage
COPY --from=build /app/backend/target/quarkus-app/lib/ /deployments/lib/
COPY --from=build /app/backend/target/quarkus-app/*.jar /deployments/
COPY --from=build /app/backend/target/quarkus-app/app/ /deployments/app/
COPY --from=build /app/backend/target/quarkus-app/quarkus/ /deployments/quarkus/

# Copy the haarcascades directory
COPY --from=build /app/backend/haarcascades /deployments/haarcascades

WORKDIR /deployments

# Expose Port
EXPOSE 80
ENTRYPOINT ./mvnw quarkus:dev

# Set the entrypoint to run the application
ENTRYPOINT ["java", "-jar", "quarkus-run.jar"]
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ docker-compose up -d
```
The application should then be reachable on localhost:5250

## Built With

Frontend:
- `Angular (v15.2.9)`
- `Bootstrap (v5.3.1)`
- `ngx-bootstrap (v10.3.0)`
- `ngx-cookie (v6.0.1)`

Backend:
- `Quarkus (v3.3.3)`
- `Maven (v3.9.6)`
- `OpenCV openpnp (v4.6.0-0)`
- `Java (v1.8)`

## Contributing
Contributions are welcome! If you have suggestions, ideas for improvements, or want to report issues, please feel free to create an issue or submit a pull request. We appreciate your input and support in making GhostFace better.

Expand Down
9 changes: 6 additions & 3 deletions backend/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
Expand Down
8 changes: 4 additions & 4 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.burningstack.ghostface</groupId>
<artifactId>backend</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.2-SNAPSHOT</version>
<description>Java-Backend for the GhostFace project</description>

<properties>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<compiler-plugin.version>3.13.0</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -19,7 +19,7 @@
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>3.3.3</quarkus.platform.version>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
<java.version>11</java.version>
<java.version>17</java.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -72,7 +72,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 8590433

Please sign in to comment.