mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2026-01-20 16:51:03 -05:00
docker-compose and docker files
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Stage 1: Build the application (The Build Stage)
|
# Stage 1: Build the application (The Build Stage)
|
||||||
# Use a Java SDK image with Maven pre-installed
|
# Use a Java SDK image with Maven pre-installed
|
||||||
FROM maven:3.9-jdk-17-slim AS build
|
FROM maven:3.9.6-eclipse-temurin-21 AS build
|
||||||
|
|
||||||
# Set the working directory inside the container
|
# Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -17,8 +17,9 @@ RUN mvn clean package -DskipTests
|
|||||||
|
|
||||||
# Stage 2: Create the final lightweight image (The Runtime Stage)
|
# Stage 2: Create the final lightweight image (The Runtime Stage)
|
||||||
# Use a smaller Java Runtime Environment (JRE) image for a smaller footprint
|
# Use a smaller Java Runtime Environment (JRE) image for a smaller footprint
|
||||||
FROM openjdk:17-jre-slim
|
FROM eclipse-temurin:21-jre
|
||||||
|
|
||||||
|
ENV SPRING_PROFILES_ACTIVE=prod
|
||||||
# Set the working directory in the final image
|
# Set the working directory in the final image
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ services:
|
|||||||
- SPRING_DATASOURCE_URL=jdbc:postgresql://r710.dev.gofwd.group:5433/ss_builder
|
- SPRING_DATASOURCE_URL=jdbc:postgresql://r710.dev.gofwd.group:5433/ss_builder
|
||||||
- SPRING_DATASOURCE_USERNAME=dba
|
- SPRING_DATASOURCE_USERNAME=dba
|
||||||
- SPRING_DATASOURCE_PASSWORD=!@#Qwerty
|
- SPRING_DATASOURCE_PASSWORD=!@#Qwerty
|
||||||
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
|
|||||||
24
push-image.sh
Executable file
24
push-image.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
REGISTRY="gitea.gofwd.group"
|
||||||
|
OWNER="forward_group/ballistic-builder-spring"
|
||||||
|
IMAGE="spring-api"
|
||||||
|
|
||||||
|
TAG=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
FULL_IMAGE="$REGISTRY/$OWNER/$IMAGE"
|
||||||
|
|
||||||
|
echo "Building $FULL_IMAGE:$TAG"
|
||||||
|
docker build -f docker/backend/Dockerfile -t $FULL_IMAGE:$TAG .
|
||||||
|
|
||||||
|
echo "Tagging latest"
|
||||||
|
docker tag $FULL_IMAGE:$TAG $FULL_IMAGE:latest
|
||||||
|
|
||||||
|
echo "Pushing $TAG"
|
||||||
|
docker push $FULL_IMAGE:$TAG
|
||||||
|
|
||||||
|
echo "Pushing latest"
|
||||||
|
docker push $FULL_IMAGE:latest
|
||||||
|
|
||||||
|
echo "Done!"
|
||||||
Reference in New Issue
Block a user