Skip to content

Commit

Permalink
✅(CI) add ngnix for the frontend
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AntoLC committed Sep 10, 2024
1 parent e471283 commit 4ba34f6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/impress-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ jobs:
run: |
make run
- name: Start Nginx for the frontend
run: |
docker compose up --force-recreate -d nginx-front
- name: Apply DRF migrations
run: |
make migrate
Expand Down Expand Up @@ -223,6 +227,10 @@ jobs:
run: |
make run
- name: Start Nginx for the frontend
run: |
docker compose up --force-recreate -d nginx-front
- name: Apply DRF migrations
run: |
make migrate
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ services:
depends_on:
- 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:
image: jwilder/dockerize

Expand Down
6 changes: 2 additions & 4 deletions src/frontend/apps/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ export default defineConfig({
},

webServer: {
command: `cd ../.. && yarn app:${
process.env.CI ? 'start -p ' : 'dev --port '
} ${PORT}`,
command: !process.env.CI ? `cd ../.. && yarn app:dev --port ${PORT}` : '',
url: baseURL,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
reuseExistingServer: true,
},

/* Configure projects for major browsers */
Expand Down
1 change: 1 addition & 0 deletions src/frontend/apps/impress/conf/default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
server {
listen 8080;
listen 3000;
server_name localhost;

root /usr/share/nginx/html;
Expand Down

0 comments on commit 4ba34f6

Please sign in to comment.