modified the nmpl/shortener:latest dockerfile ti not rely on git during build

This commit is contained in:
Amit Kumar Nandi 2024-03-02 21:32:33 +05:30
parent 9767302883
commit 04688cf473
2 changed files with 5 additions and 7 deletions

View file

@ -14,10 +14,12 @@ ARG TAG=$VERSION
FROM maven:3.9.6-eclipse-temurin-21 AS builder FROM maven:3.9.6-eclipse-temurin-21 AS builder
#Cloud Install : Clone the repository #Cloud Install : Clone the repository
RUN git clone https://github.com/aamitn/URLShortener.git #RUN git clone https://github.com/aamitn/URLShortener.git
RUN mkdir -p URLShortener
#Local Install #Local Install
#ADD . /UrlShortener ADD . /URLShortener
# Change working directory to the repo directory # Change working directory to the repo directory
WORKDIR /URLShortener WORKDIR /URLShortener
@ -26,7 +28,7 @@ WORKDIR /URLShortener
# Example real world db access url : mysql://127.0.0.1:3306 # Example real world db access url : mysql://127.0.0.1:3306
# Example Docker db access url : mysql://database:3306 (container name is datbase) # Example Docker db access url : mysql://database:3306 (container name is datbase)
# Change the database ip in app config to the database docker container name/service # Change the database ip in app config to the database docker container name/service
RUN sed -i "s|database.ip=127.0.0.1|database.ip=database |g" src/main/resources/application.properties RUN sed -i "s|database.ip=127.0.0.1|database.ip=database|g" src/main/resources/application.properties
# Build the application # Build the application
RUN mvn clean install RUN mvn clean install

View file

@ -4,7 +4,6 @@ services:
shortener-app: shortener-app:
labels: labels:
- "TUSC" - "TUSC"
#Build from docker hub image .Comment/Uncomment Below #Build from docker hub image .Comment/Uncomment Below
image: nmpl/shortener:k8s image: nmpl/shortener:k8s
@ -15,12 +14,9 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
- "3306:3306" - "3306:3306"
volumes: volumes:
- data:/var/lib/mysql - data:/var/lib/mysql
restart: unless-stopped restart: unless-stopped
volumes: volumes:
data: data: