Merge branch 'main' into frontend
This commit is contained in:
@@ -1,19 +1,29 @@
|
||||
FROM node:latest as build
|
||||
|
||||
# Change to the project directory
|
||||
WORKDIR /usr/local/app
|
||||
|
||||
# Copy the project files to the container
|
||||
COPY frontend /usr/local/app/
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
RUN ls /usr/local/app/dist
|
||||
|
||||
|
||||
FROM nginx:latest
|
||||
|
||||
# Copy the project files to the container
|
||||
COPY --from=build /usr/local/app/dist/aktienbot /usr/share/nginx/html
|
||||
|
||||
# Copy configuration files
|
||||
COPY frontend/deploy/nginx.conf /etc/nginx
|
||||
COPY frontend/deploy deploy/
|
||||
|
||||
# Change file permissions
|
||||
RUN chmod +x ./deploy/healthcheck.sh
|
||||
|
||||
# set healthcheck
|
||||
HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
||||
|
||||
# Expose webserver port
|
||||
EXPOSE 80
|
||||
|
@@ -25,3 +25,4 @@ Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To u
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
||||
|
||||
|
@@ -1,2 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
curl -s http://localhost:80/ -o /dev/null || exit 1
|
||||
|
34
frontend/deploy/nginx.conf
Normal file
34
frontend/deploy/nginx.conf
Normal file
@@ -0,0 +1,34 @@
|
||||
events {
|
||||
worker_connections 1024; ## Default: 1024
|
||||
}
|
||||
|
||||
http {
|
||||
## use mime types
|
||||
include /etc/nginx/mime.types;
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
## without this our .css are not loaded
|
||||
try_files $uri $uri/ /index.html?$query_string;
|
||||
}
|
||||
}
|
||||
|
||||
## enable gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/javascript
|
||||
application/javascript
|
||||
application/x-javascript
|
||||
application/xml
|
||||
application/json
|
||||
application/ld+json;
|
||||
}
|
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
const AUTH_API = 'https://gruppe1.testsites.info/api/user';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
Reference in New Issue
Block a user