(CI) add ngnix for the frontend

Because of the Next.js bug with the 404 on the
dynamic routes, we are not able to assert some
behaviors from the e2e tests and the CI.
So we are adding a ngnix to the CI e2e tests
to be able to route correctly our frontend.
This commit is contained in:
Anthony LC
2024-09-10 15:33:21 +02:00
committed by Anthony LC
parent e4712831f2
commit 4ba34f6c80
4 changed files with 19 additions and 4 deletions

View File

@@ -149,6 +149,10 @@ jobs:
run: | run: |
make run make run
- name: Start Nginx for the frontend
run: |
docker compose up --force-recreate -d nginx-front
- name: Apply DRF migrations - name: Apply DRF migrations
run: | run: |
make migrate make migrate
@@ -223,6 +227,10 @@ jobs:
run: | run: |
make run make run
- name: Start Nginx for the frontend
run: |
docker compose up --force-recreate -d nginx-front
- name: Apply DRF migrations - name: Apply DRF migrations
run: | run: |
make migrate make migrate

View File

@@ -121,6 +121,14 @@ services:
depends_on: depends_on:
- keycloak - keycloak
nginx-front:
image: nginx:1.25
ports:
- "3000:3000"
volumes:
- ./src/frontend/apps/impress/conf/default.conf:/etc/nginx/conf.d/default.conf
- ./src/frontend/apps/impress/out:/usr/share/nginx/html
dockerize: dockerize:
image: jwilder/dockerize image: jwilder/dockerize

View File

@@ -32,12 +32,10 @@ export default defineConfig({
}, },
webServer: { webServer: {
command: `cd ../.. && yarn app:${ command: !process.env.CI ? `cd ../.. && yarn app:dev --port ${PORT}` : '',
process.env.CI ? 'start -p ' : 'dev --port '
} ${PORT}`,
url: baseURL, url: baseURL,
timeout: 120 * 1000, timeout: 120 * 1000,
reuseExistingServer: !process.env.CI, reuseExistingServer: true,
}, },
/* Configure projects for major browsers */ /* Configure projects for major browsers */

View File

@@ -1,5 +1,6 @@
server { server {
listen 8080; listen 8080;
listen 3000;
server_name localhost; server_name localhost;
root /usr/share/nginx/html; root /usr/share/nginx/html;