This commit is contained in:
miwr 2025-04-15 14:48:11 +02:00
parent 2bb12bfc2b
commit 81e175985d
4 changed files with 10 additions and 9 deletions

View file

@ -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

View file

@ -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) {}

View file

@ -0,0 +1,4 @@
export const environment = {
production: true,
apiBaseUrl: 'http://localhost:8080/game/jump'
};

View file

@ -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'
};