[Updated] Dockerfiles so everything runs using docker compose up, added the benchmark and speed tests
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://localhost:9090'
|
||||
};
|
||||
Reference in New Issue
Block a user