-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ls1intum/integrate-new-server
Integrate new server
- Loading branch information
Showing
22 changed files
with
284 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
# Stage 1: Build the Angular app | ||
FROM node:20-alpine AS build | ||
WORKDIR /app | ||
|
||
# Copy package files and install dependencies | ||
COPY package.json package-lock.json ./ | ||
RUN npm install | ||
|
||
# Copy the application code and build the app | ||
COPY . ./ | ||
RUN npm install | ||
RUN npm run build -- --configuration=production | ||
RUN npm run build -- --configuration=production --base-href=/chatbot/ | ||
|
||
# Stage 2: Serve the app with NGINX | ||
FROM nginx:stable-alpine | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=build /app/dist/angelos-ui/browser /usr/share/nginx/html | ||
COPY --from=build /app/dist/chatbot/browser /usr/share/nginx/html | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
# Start NGINX | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
services: | ||
angelos-ui: | ||
chatbot: | ||
image: "ghcr.io/ls1intum/angelos-ui:latest" | ||
container_name: angelos-ui | ||
ports: | ||
- "443:443" | ||
container_name: chatbot | ||
expose: | ||
- "443" | ||
volumes: | ||
- type: bind | ||
source: /var/lib/rbg-cert/2024-10-31T11:10:43+01:00 | ||
target: /etc/ssl/certs | ||
- "80" | ||
networks: | ||
- angelos-network | ||
- angelos-network | ||
|
||
networks: | ||
angelos-network: | ||
external: true | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,23 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name chatbot.ase.cit.tum.de www.chatbot.ase.cit.tum.de; | ||
|
||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
http2 on; | ||
server_name chatbot.ase.cit.tum.de www.chatbot.ase.cit.tum.de; | ||
|
||
# SSL Certificate files | ||
ssl_certificate /etc/ssl/certs/host:f:asevm83.cit.tum.de.cert.pem; | ||
ssl_certificate_key /etc/ssl/certs/host:f:asevm83.cit.tum.de.privkey.pem; | ||
|
||
# SSL Settings (recommended for security) | ||
# ssl_dhparam /etc/nginx/dhparam.pem; | ||
ssl_prefer_server_ciphers on; | ||
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; | ||
ssl_ecdh_curve secp384r1; | ||
ssl_session_timeout 10m; | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_tickets off; | ||
ssl_stapling on; | ||
ssl_stapling_verify on; | ||
# ssl_early_data on; | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location /api/ { | ||
proxy_pass http://angelos-app:8000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Internal-Access "true"; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
|
||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
server_name localhost; | ||
|
||
# Serve Angular app from /usr/share/nginx/html | ||
root /usr/share/nginx/html; | ||
index index.csr.html; | ||
|
||
# Handle Angular routing | ||
location /chatbot/ { | ||
try_files $uri /index.csr.html; | ||
} | ||
|
||
# Redirect 404 errors to Angular's index.csr.html | ||
error_page 404 /index.csr.html; | ||
|
||
# Optional: Cache static files | ||
location ~* \.(?:ico|css|js|woff2?|eot|ttf|otf|svg|png|jpg|jpeg|gif|webp|avif|mp4|webm|ogg|mp3|wav|flac|aac)$ { | ||
expires 6M; | ||
access_log off; | ||
add_header Cache-Control "public"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,4 +178,5 @@ $logo-size: 40px; | |
transform: translateY(-2px); | ||
opacity: 0.7; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface StudyProgram { | ||
id: number; | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.