[Updated] Dockerfiles so everything runs using docker compose up, added the benchmark and speed tests

This commit is contained in:
Ninjaws
2024-11-01 19:52:53 +01:00
parent 675bdc7f8e
commit 595b83b364
14 changed files with 143 additions and 17 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ COPY package*.json ./
RUN npm install
# Copied here, since the the Development setup uses a bind volume instead
COPY . .
RUN npm run build --prod
RUN ng build --configuration production
#--- Production
FROM nginx:alpine AS production
+6
View File
@@ -50,6 +50,12 @@
"maximumError": "4kB"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
@@ -18,12 +18,13 @@ import { Answers } from '../models/answers';
import { StorageService } from './storage.service';
import { CleanerService } from './cleaner.service';
import { ResponseHandlerService } from './response-handler.service';
import { environment } from '../../../environments/environment';
@Injectable({
providedIn: 'root',
})
export class QuizService {
private apiUrl = 'http://localhost:9090/quiz';
private apiUrl = environment.apiUrl + '/quiz';
constructor(
private http: HttpClient,
@@ -0,0 +1,6 @@
export const environment = {
production: true,
/** Connecting through the docker compose network is not working for now, so I'll have to use the localhost */
// apiUrl: 'http://backend:9090',
apiUrl: 'http://localhost:9090',
};
+4
View File
@@ -0,0 +1,4 @@
export const environment = {
production: false,
apiUrl: 'http://localhost:9090'
};