35 Commits
Author SHA1 Message Date
Ninjaws bfcc6d7ffe Update docker-compose.yml 2024-11-08 17:02:46 +00:00
Ninjaws 488bb99c1a Merge pull request 'develop -> main' (#8) from develop into main
Reviewed-on: Ninjaws/quiz#8
2024-11-08 16:21:07 +00:00
Ninjaws dcbcabbe4d Update .gitea/workflows/deploy.yaml 2024-11-08 16:19:58 +00:00
Ninjaws fe5701e798 Update .gitea/workflows/testing.yaml 2024-11-08 16:17:46 +00:00
Ninjaws 74cebb7766 Update .gitea/workflows/testing.yaml 2024-11-08 15:39:11 +00:00
Ninjaws 0d65b76a1a [Updated] Workflow image 2024-11-08 13:05:33 +01:00
Ninjaws 83ac570592 Merge pull request 'develop' (#7) from develop into main
Reviewed-on: Ninjaws/quiz#7
2024-11-07 22:07:11 +00:00
Ninjaws ded5349998 Change back 2024-11-07 23:05:59 +01:00
Ninjaws 67b520ae08 Deployment workflow 2024-11-07 23:03:57 +01:00
Ninjaws eb59e29dc8 Merge pull request 'Test' (#6) from develop into main
Reviewed-on: Ninjaws/quiz#6
2024-11-07 21:57:46 +00:00
Ninjaws 0b8527dbd8 Test 2024-11-07 22:55:50 +01:00
Ninjaws 3e29ecba97 Merge pull request 'develop -> main' (#5) from develop into main
Reviewed-on: Ninjaws/quiz#5
2024-11-07 21:51:09 +00:00
Ninjaws e1359b7958 Update .gitea/workflows/demo.yaml 2024-11-07 21:45:49 +00:00
Ninjaws 32dcb3a21b Update .gitea/workflows/demo.yaml 2024-11-07 21:37:10 +00:00
Ninjaws 42efaf9cf1 Update .gitea/workflows/demo.yaml 2024-11-07 21:35:02 +00:00
Ninjaws 83a4bf7817 Update .gitea/workflows/demo.yaml 2024-11-07 21:31:26 +00:00
Ninjaws 8d1a25466d Update .gitea/workflows/demo.yaml 2024-11-07 21:29:05 +00:00
Ninjaws 8231aa658d Update .gitea/workflows/demo.yaml 2024-11-07 21:23:23 +00:00
Ninjaws dc13af31b0 Update .gitea/workflows/demo.yaml 2024-11-07 21:18:26 +00:00
Ninjaws 95cfd6b574 Update .gitea/workflows/demo.yaml 2024-11-07 21:14:17 +00:00
Ninjaws 88a316dda6 er 2024-11-07 21:11:58 +00:00
Ninjaws 75329f85f5 wf 2024-11-07 21:06:54 +00:00
Ninjaws 25599780dd 3r 2024-11-07 21:02:25 +00:00
Ninjaws 51d724c1db ef 2024-11-07 21:00:26 +00:00
Ninjaws 41f869a287 Bla 2024-11-07 20:57:38 +00:00
Ninjaws a224b16f24 Updated workflow to publish app 6 2024-11-07 21:54:08 +01:00
Ninjaws caa4add86a Updated workflow to publish app 6 2024-11-07 21:52:42 +01:00
Ninjaws b48748b462 Updated workflow to publish app 5 2024-11-07 21:48:11 +01:00
Ninjaws d53a195986 Updated workflow to publish app 4 2024-11-07 20:46:30 +01:00
Ninjaws 4d2fece46d Updated workflow to publish app 3 2024-11-07 19:02:15 +01:00
Ninjaws ee379ee251 Updated workflow to publish app 2 2024-11-07 18:36:05 +01:00
Ninjaws 81c49eef16 Updated workflow to publish app 2024-11-07 18:30:34 +01:00
Ninjaws ff3a382a0e Merge pull request 'Added Demo workflow' (#4) from develop into main
Reviewed-on: Ninjaws/quiz#4
2024-11-07 15:45:08 +00:00
Ninjaws e213d99cf2 Added Demo workflow 2024-11-07 16:41:57 +01:00
Ninjaws 10c4aa8831 Added Project 2024-11-06 22:13:00 +01:00
9 changed files with 108 additions and 4 deletions
+14
View File
@@ -0,0 +1,14 @@
name: Quiz App Deployment
run-name: ${{ gitea.actor }} is deploying Quiz App
on:
push:
branches:
- main
jobs:
Quiz Runner:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: docker compose up -d --build
+13
View File
@@ -0,0 +1,13 @@
name: Quiz App Testing
run-name: ${{ gitea.actor }} is testing Quiz App
on: [push]
jobs:
Quiz Runner:
runs-on: ubuntu-latest
steps:
- run: docker --version
- run: docker compose version
- name: Check out repository code
uses: actions/checkout@v4
# Run tests
@@ -12,7 +12,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // Allow all endpoints registry.addMapping("/**") // Allow all endpoints
.allowedOrigins("http://localhost:4200") // Allow specific origin .allowedOrigins("http://localhost:4200", "https://quiz.ianvink.nl") // Allow specific origin
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // Allow specific methods .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // Allow specific methods
.allowedHeaders("*") // Allow all headers .allowedHeaders("*") // Allow all headers
.allowCredentials(true); // Allow credentials .allowCredentials(true); // Allow credentials
@@ -1,4 +1,5 @@
spring.application.name=quiz spring.application.name=quiz
server.address=0.0.0.0
server.port=9090 server.port=9090
# H2 Database configuration # H2 Database configuration
+14 -1
View File
@@ -8,6 +8,11 @@ services:
container_name: quiz-frontend-prod-cont container_name: quiz-frontend-prod-cont
ports: ports:
- "4200:80" - "4200:80"
networks:
- quiz-network
restart: always
cpu_period: 100000 # Default is 100,000 microseconds (100ms)
cpu_quota: 5000 # 5% of the total CPU time
backend: backend:
build: build:
context: ./backend context: ./backend
@@ -16,4 +21,12 @@ services:
image: quiz-backend-prod image: quiz-backend-prod
container_name: quiz-backend-prod-cont container_name: quiz-backend-prod-cont
ports: ports:
- "9090:9090" - "9090:9090"
networks:
- quiz-network
restart: always
cpu_period: 100000 # Default is 100,000 microseconds (100ms)
cpu_quota: 5000 # 5% of the total CPU time
networks:
quiz-network: # Define the network
+1
View File
@@ -27,5 +27,6 @@ RUN ng build --configuration production
#--- Production #--- Production
FROM nginx:alpine AS production FROM nginx:alpine AS production
COPY --from=build /app/dist/quiz/browser /usr/share/nginx/html COPY --from=build /app/dist/quiz/browser /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
+61
View File
@@ -0,0 +1,61 @@
server {
listen 80;
# server_name quiz.ianvink.nl;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_read_timeout 360s;
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;
# add_header 'Access-Control-Allow-Origin' '*'; # Adjust this to your frontend domain
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; # Include POST
# add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization'; # Include any other headers
proxy_pass http://backend:9090/;
}
}
# server {
# listen 80;
# server_name quiz.ianvink.nl;
# location /.well-known/acme-challenge/ {
# root /usr/share/nginx/html; # Adjust this if needed
# }
# location / {
# return 301 https://$host$request_uri;
# }
# }
# server {
# listen 443 ssl;
# server_name quiz.example.com;
# ssl_certificate /etc/letsencrypt/live/quiz.example.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/quiz.example.com/privkey.pem;
# location / {
# root /usr/share/nginx/html;
# index index.html;
# try_files $uri $uri/ /index.html;
# }
# location /api/ {
# proxy_pass http://backend:9090/; # Adjust this if needed
# 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;
# }
# }
@@ -32,4 +32,4 @@
Start Quiz Start Quiz
</button> </button>
</div> </div>
</div> </div>
@@ -2,5 +2,6 @@ export const environment = {
production: true, production: true,
/** Connecting through the docker compose network is not working for now, so I'll have to use the localhost */ /** 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://backend:9090',
apiUrl: 'http://localhost:9090', apiUrl: '/api' //'https://api.nosotros.ianvink.nl',
// apiUrl: 'http://localhost:9090',
}; };