Skip to content

Build Docker image on slim base #3204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
44075da
Build Docker image on slim base
AndrewFerr Apr 14, 2025
018031c
Merge branch 'livekit' into af/docker/slim
AndrewFerr Apr 22, 2025
770af22
Add missing EW volume label for playwright compose
AndrewFerr Apr 22, 2025
073baca
Run Playwright tests against Docker container
AndrewFerr Apr 22, 2025
4cc8175
Try to fix CI
AndrewFerr Apr 22, 2025
f8db3e6
Merge branch 'livekit' into af/docker/slim
AndrewFerr Apr 29, 2025
34ee11c
Merge branch 'livekit' into af/docker/slim
AndrewFerr May 22, 2025
9675de5
Merge branch 'livekit' into af/docker/slim
fkwp May 27, 2025
2881917
Merge branch 'fkwp/docker_compose/resolve_conflicting_ports' into af/…
fkwp May 27, 2025
491b168
Merge branch 'fkwp/docker_compose/resolve_conflicting_ports' into af/…
fkwp May 27, 2025
0cdd2cb
fix USE_DOCKER port
fkwp May 27, 2025
ac8f4d8
fix element web fixture protocol
fkwp May 27, 2025
71113e1
Merge branch 'fkwp/docker_compose/resolve_conflicting_ports' into af/…
fkwp May 30, 2025
78ba046
wip
fkwp May 30, 2025
eabb27b
Merge branch 'livekit' into af/docker/slim
fkwp May 30, 2025
e1e41b9
Build test image to local Docker registry
AndrewFerr Jun 5, 2025
af4dd37
Shut down playwright webserver gracefully
AndrewFerr Jun 5, 2025
164be2e
Use full test image name when running it
AndrewFerr Jun 5, 2025
298aced
Enable verbose Playwright logging in CI
AndrewFerr Jun 5, 2025
6d3a641
Increase Playwright timeout in CI
AndrewFerr Jun 5, 2025
d5b714f
Revert "Enable verbose Playwright logging in CI"
AndrewFerr Jun 5, 2025
925df13
Upload nginx logs for Playwright CI test
AndrewFerr Jun 5, 2025
5a84936
Fix typo in Docker volume location
AndrewFerr Jun 6, 2025
d8ec2e6
Revert debugging changes for Playwright
AndrewFerr Jun 6, 2025
18f5e03
Fix new typo
AndrewFerr Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail_ci_if_error: true
playwright:
name: Run end-to-end tests
timeout-minutes: 10
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand All @@ -49,9 +49,9 @@ jobs:
docker compose -f playwright-backend-docker-compose.yml -f playwright-backend-docker-compose.override.yml pull
docker compose -f playwright-backend-docker-compose.yml -f playwright-backend-docker-compose.override.yml up -d
docker ps
- name: Copy config file
run: cp config/config.devenv.json public/config.json
- name: Run Playwright tests
env:
USE_DOCKER: 1
run: yarn playwright test
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./dist /dist
WORKDIR /dist/assets
RUN gzip -k ../index.html *.js *.map *.css *.wasm *-app-*.json

FROM nginxinc/nginx-unprivileged:alpine
FROM nginxinc/nginx-unprivileged:alpine-slim

COPY --from=builder ./dist /app

Expand Down
14 changes: 11 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Please see LICENSE in the repository root for full details.

import { defineConfig, devices } from "@playwright/test";

const baseURL = process.env.USE_DOCKER
? "http://localhost:8080"
: "https://localhost:3000";

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand All @@ -25,7 +29,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "https://localhost:3000",
baseURL,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
Expand Down Expand Up @@ -73,9 +77,13 @@ export default defineConfig({

/* Run your local dev server before starting the tests */
webServer: {
command: "yarn dev",
url: "https://localhost:3000",
command: "./scripts/playwright-webserver-command.sh",
url: baseURL,
reuseExistingServer: !process.env.CI,
ignoreHTTPSErrors: true,
gracefulShutdown: {
signal: "SIGTERM",
timeout: 500,
},
},
});
31 changes: 21 additions & 10 deletions playwright/fixtures/widget-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,27 @@ const CONFIG_JSON = {
* Set the Element Call URL in the dev tool settings using `window.mxSettingsStore` via `page.evaluate`.
* @param page
*/
async function setDevToolElementCallDevUrl(page: Page): Promise<void> {
await page.evaluate(() => {
window.mxSettingsStore.setValue(
"Developer.elementCallUrl",
null,
"device",
"https://localhost:3000/room",
);
});
}
const setDevToolElementCallDevUrl = process.env.USE_DOCKER
? async (page: Page): Promise<void> => {
await page.evaluate(() => {
window.mxSettingsStore.setValue(
"Developer.elementCallUrl",
null,
"device",
"http://localhost:8080/room",
);
});
}
: async (page: Page): Promise<void> => {
await page.evaluate(() => {
window.mxSettingsStore.setValue(
"Developer.elementCallUrl",
null,
"device",
"https://localhost:3000/room",
);
});
};

/**
* Registers a new user and returns page, clientHandle and mxId.
Expand Down
10 changes: 10 additions & 0 deletions scripts/playwright-webserver-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
if [ -n "$USE_DOCKER" ]; then
set -ex
yarn build
docker build -t element-call:testing .
exec docker run --rm --name element-call-testing -p 8080:8080 -v ./config/config.devenv.json:/app/config.json:ro,Z element-call:testing
else
cp config/config.devenv.json public/config.json
exec yarn dev
fi