Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c2c561182 | ||
|
|
e1b04745b2 | ||
|
|
b82dfdbe17 | ||
|
|
c26c298a41 | ||
|
|
ec5a1de584 | ||
|
|
121dff910d | ||
|
|
ddc421b4b3 | ||
|
|
595b83b364 | ||
|
|
675bdc7f8e | ||
|
|
3188f6ce20 | ||
|
|
2505fce920 | ||
|
|
bf66869ebf | ||
|
|
1a992a871e | ||
|
|
e62369533e | ||
|
|
13b1ad0c2e |
@@ -1,14 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
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", "https://quiz.ianvink.nl") // Allow specific origin
|
.allowedOrigins("http://localhost:4200") // 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,5 +1,4 @@
|
|||||||
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
|
||||||
|
|||||||
@@ -8,11 +8,6 @@ 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
|
||||||
@@ -22,11 +17,3 @@ services:
|
|||||||
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
|
|
||||||
@@ -27,6 +27,5 @@ 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;"]
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
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;
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
@@ -2,6 +2,5 @@ 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: '/api' //'https://api.nosotros.ianvink.nl',
|
apiUrl: 'http://localhost:9090',
|
||||||
// apiUrl: 'http://localhost:9090',
|
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user