-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DV-000303: Add map location real time.
- Loading branch information
1 parent
a90ac65
commit 617d016
Showing
12 changed files
with
657 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,31 @@ | ||
# Stage 1: Build | ||
FROM gradle:7.4.2-jdk-alpine AS TEMP_BUILD_IMAGE | ||
|
||
# Install dependencies in a single layer | ||
# Install dependencies | ||
RUN apk add --no-cache bash \ | ||
&& echo "@personal https://dl-cdn.alpinelinux.org/alpine/v3.9/main" >> /etc/apk/repositories \ | ||
&& echo "@personal https://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories \ | ||
&& apk add --no-cache nodejs@personal npm@personal \ | ||
&& node --version \ | ||
&& npm --version | ||
|
||
# Set the working directory | ||
WORKDIR /usr/app/ | ||
ENV APP_HOME=/usr/app/ | ||
|
||
# Copy only necessary files for dependency resolution and building | ||
COPY build.gradle settings.gradle ./ | ||
COPY gradle ./gradle | ||
|
||
# Ensure Gradle runs as non-root user | ||
RUN chown -R gradle:gradle ./ | ||
|
||
USER gradle | ||
WORKDIR $APP_HOME | ||
COPY build.gradle settings.gradle $APP_HOME | ||
|
||
# Build the application, skipping tests for faster builds | ||
ARG REACT_APP_TOKEN | ||
ENV REACT_APP_TOKEN $REACT_APP_TOKEN | ||
COPY gradle $APP_HOME/gradle/ | ||
COPY --chown=gradle:gradle . /home/gradle/src | ||
|
||
COPY . . | ||
RUN gradle clean npm_run_build copyTask build -x test --no-daemon || return 0 | ||
|
||
# Stage 2: Package | ||
FROM eclipse-temurin:21-jdk-alpine | ||
|
||
# Add curl (if needed) in a single command to minimize layers | ||
FROM eclipse-temurin:17-jdk-alpine | ||
RUN apk --no-cache add curl | ||
|
||
# Define environment variables | ||
ENV ARTIFACT_NAME=simpleRegions-0.0.1-SNAPSHOT.jar | ||
ENV APP_HOME=/usr/app | ||
|
||
# Set the working directory | ||
WORKDIR $APP_HOME | ||
|
||
# Copy the built artifact from the build stage | ||
COPY --from=TEMP_BUILD_IMAGE /usr/app/build/libs/$ARTIFACT_NAME app.jar | ||
|
||
# Use a non-root user to run the application | ||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup | ||
USER appuser | ||
COPY --from=TEMP_BUILD_IMAGE $APP_HOME/build/libs/$ARTIFACT_NAME app.jar | ||
|
||
# Expose the application's port | ||
EXPOSE 8080 | ||
|
||
# Set the entry point to run the jar | ||
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=docker", "/app.jar"] | ||
ENTRYPOINT ["java", "-jar","-Dspring.profiles.active=docker", "/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM node:20-alpine | |
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json ./ | ||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
|
Oops, something went wrong.