diff --git a/Dockerfile b/Dockerfile index bd039cb..30870d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ WORKDIR /URLShortener # Example real world db access url : mysql://127.0.0.1:3306 # 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 -RUN sed -i "s|database.ip=127.0.0.1|database.ip=db |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 RUN mvn clean install diff --git a/docker-compose.yml b/docker-compose.yml index fffb898..de25b16 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ volumes: data: services: - db: + database: image: mariadb environment: MYSQL_ROOT_PASSWORD: 1234qwer @@ -39,5 +39,5 @@ services: ports: - "8080:8080" depends_on: - - db + - database diff --git a/shortener-deployment.yaml b/shortener-deployment.yaml deleted file mode 100644 index ec1e253..0000000 --- a/shortener-deployment.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: shortener-deployment - labels: - app: shortener -spec: - replicas: 3 # Adjust as needed - selector: - matchLabels: - app: shortener - template: - metadata: - labels: - app: shortener - spec: - containers: - - name: shortener - image: nmpl/shortener:latest - ports: - - containerPort: 8080 \ No newline at end of file diff --git a/shortener-service.yaml b/shortener-service.yaml deleted file mode 100644 index 0382b04..0000000 --- a/shortener-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: shortener-service -spec: - selector: - app: shortener - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - type: LoadBalancer \ No newline at end of file