.
This commit is contained in:
+3
-5
@@ -3,8 +3,7 @@ WORKDIR /app
|
|||||||
COPY ./pom.xml ./
|
COPY ./pom.xml ./
|
||||||
RUN mvn dependency:resolve
|
RUN mvn dependency:resolve
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN mvn clean install
|
RUN mvn clean install -DskipTests
|
||||||
# -DskipTests
|
|
||||||
|
|
||||||
FROM openjdk:21-jdk-slim
|
FROM openjdk:21-jdk-slim
|
||||||
|
|
||||||
@@ -17,12 +16,11 @@ RUN mkdir /dumps && chown appuser:appgroup /dumps
|
|||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the application jar and .env file from the build stage
|
# Copy the application jar from the build stage
|
||||||
COPY --from=build /app/target/*.jar app.jar
|
COPY --from=build /app/target/*.jar app.jar
|
||||||
COPY --from=build /app/.env .env
|
|
||||||
|
|
||||||
# Change ownership of the application files to the non-root user
|
# Change ownership of the application files to the non-root user
|
||||||
RUN chown appuser:appgroup app.jar .env
|
RUN chown appuser:appgroup app.jar
|
||||||
|
|
||||||
# Switch to the non-root user
|
# Switch to the non-root user
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: konturai
|
name: konturai
|
||||||
datasource:
|
datasource:
|
||||||
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://92.38.48.166:5433/konturai}
|
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://db:5432/konturai}
|
||||||
username: ${POSTGRES_USER:postgres}
|
username: ${POSTGRES_USER:postgres}
|
||||||
password: ${POSTGRES_PASSWORD:password}
|
password: ${POSTGRES_PASSWORD:konturai2024}
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
jpa:
|
jpa:
|
||||||
hibernate:
|
hibernate:
|
||||||
|
|||||||
Reference in New Issue
Block a user