-
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
3034974
commit a90ac65
Showing
7 changed files
with
3,936 additions
and
29 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,34 +1,53 @@ | ||
# Stage 1: Build | ||
FROM gradle:7.4.2-jdk-alpine AS TEMP_BUILD_IMAGE | ||
|
||
RUN apk add --no-cache bash | ||
RUN echo "@personal http://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories | ||
RUN apk add nodejs@personal npm@personal | ||
RUN node --version | ||
RUN npm --version | ||
# Install dependencies in a single layer | ||
RUN apk add --no-cache bash \ | ||
&& echo "@personal https://dl-cdn.alpinelinux.org/alpine/v3.9/main" >> /etc/apk/repositories \ | ||
&& apk add --no-cache nodejs@personal npm@personal \ | ||
&& node --version \ | ||
&& npm --version | ||
|
||
ENV APP_HOME=/usr/app/ | ||
# Set the working directory | ||
WORKDIR /usr/app/ | ||
|
||
WORKDIR $APP_HOME | ||
COPY build.gradle settings.gradle $APP_HOME | ||
# Copy only necessary files for dependency resolution and building | ||
COPY build.gradle settings.gradle ./ | ||
COPY gradle ./gradle | ||
|
||
COPY gradle $APP_HOME/gradle/ | ||
COPY --chown=gradle:gradle . /home/gradle/src | ||
# Ensure Gradle runs as non-root user | ||
RUN chown -R gradle:gradle ./ | ||
|
||
COPY . . | ||
USER gradle | ||
|
||
# Build the application, skipping tests for faster builds | ||
ARG REACT_APP_TOKEN | ||
ENV REACT_APP_TOKEN $REACT_APP_TOKEN | ||
|
||
RUN gradle clean npm_run_build copyTask build -x test --no-daemon || return 0 | ||
|
||
FROM eclipse-temurin:17-jdk-alpine | ||
# Stage 2: Package | ||
FROM eclipse-temurin:21-jdk-alpine | ||
|
||
# Add curl (if needed) in a single command to minimize layers | ||
RUN apk --no-cache add curl | ||
|
||
# Define environment variables | ||
ENV ARTIFACT_NAME=simpleRegions-0.0.1-SNAPSHOT.jar | ||
ENV APP_HOME=/usr/app | ||
|
||
COPY --from=TEMP_BUILD_IMAGE $APP_HOME/build/libs/$ARTIFACT_NAME app.jar | ||
# 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 | ||
|
||
# Expose the application's port | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["java", "-jar","-Dspring.profiles.active=docker", "/app.jar"] | ||
# Set the entry point to run the 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
npm-debug.log | ||
.DS_Store | ||
.git | ||
.gitignore | ||
.env |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.