Skip to content

Commit 4ba34f6

Browse files
committed
✅(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.
1 parent e471283 commit 4ba34f6

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.github/workflows/impress-frontend.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ jobs:
149149
run: |
150150
make run
151151
152+
- name: Start Nginx for the frontend
153+
run: |
154+
docker compose up --force-recreate -d nginx-front
155+
152156
- name: Apply DRF migrations
153157
run: |
154158
make migrate
@@ -223,6 +227,10 @@ jobs:
223227
run: |
224228
make run
225229
230+
- name: Start Nginx for the frontend
231+
run: |
232+
docker compose up --force-recreate -d nginx-front
233+
226234
- name: Apply DRF migrations
227235
run: |
228236
make migrate

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ services:
121121
depends_on:
122122
- keycloak
123123

124+
nginx-front:
125+
image: nginx:1.25
126+
ports:
127+
- "3000:3000"
128+
volumes:
129+
- ./src/frontend/apps/impress/conf/default.conf:/etc/nginx/conf.d/default.conf
130+
- ./src/frontend/apps/impress/out:/usr/share/nginx/html
131+
124132
dockerize:
125133
image: jwilder/dockerize
126134

src/frontend/apps/e2e/playwright.config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ export default defineConfig({
3232
},
3333

3434
webServer: {
35-
command: `cd ../.. && yarn app:${
36-
process.env.CI ? 'start -p ' : 'dev --port '
37-
} ${PORT}`,
35+
command: !process.env.CI ? `cd ../.. && yarn app:dev --port ${PORT}` : '',
3836
url: baseURL,
3937
timeout: 120 * 1000,
40-
reuseExistingServer: !process.env.CI,
38+
reuseExistingServer: true,
4139
},
4240

4341
/* Configure projects for major browsers */

src/frontend/apps/impress/conf/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
server {
22
listen 8080;
3+
listen 3000;
34
server_name localhost;
45

56
root /usr/share/nginx/html;

0 commit comments

Comments
 (0)