diff --git a/Dockerfile b/Dockerfile index 9cb7073..2e6d2b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,9 @@ WORKDIR /app COPY package*.json ./ RUN npm install --legacy-peer-deps # or yarn install COPY . . -ARG IN_CLUSTER=true -RUN if [ "$IN_CLUSTER" = "true" ]; then \ - cp src/environments/environment.cluster.ts src/environments/environment.ts; \ - cp src/environments/environment.cluster.ts proof/environment.ts; \ +ARG LOCAL=false +RUN if [ "$LOCAL" = "true" ]; then \ + cp src/environments/environment.local.ts src/environments/environment.ts; \ fi RUN npm run build --prod diff --git a/src/app/jump.service.ts b/src/app/jump.service.ts index a9daa55..c655e8a 100644 --- a/src/app/jump.service.ts +++ b/src/app/jump.service.ts @@ -1,13 +1,11 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { environment } from '../enviroments/environment.cluster'; +import { environment } from '../enviroments/environment'; @Injectable({ providedIn: 'root' }) export class JumpService { - private apiUrl = environment.apiBaseUrl === '' - ? 'http://localhost:8080/game/jump' - : environment.apiBaseUrl; + private apiUrl = environment.apiBaseUrl; constructor(private http: HttpClient) {} diff --git a/src/enviroments/environment.local.ts b/src/enviroments/environment.local.ts new file mode 100644 index 0000000..7746075 --- /dev/null +++ b/src/enviroments/environment.local.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + apiBaseUrl: 'http://localhost:8080/game/jump' + }; \ No newline at end of file diff --git a/src/enviroments/environment.cluster.ts b/src/enviroments/environment.ts similarity index 86% rename from src/enviroments/environment.cluster.ts rename to src/enviroments/environment.ts index da89574..cd9ec10 100644 --- a/src/enviroments/environment.cluster.ts +++ b/src/enviroments/environment.ts @@ -1,4 +1,4 @@ export const environment = { production: true, - apiBaseUrl: 'http://silly-game-service.silly-game.svc.cluster.local' + apiBaseUrl: 'http://silly-game-service.silly-game.svc.cluster.local/game/jump' }; \ No newline at end of file