Skip to content
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

Setup docker config for e2e #889

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/engine/reference/builder/#dockerignore-file

**/.classpath
**/.dockerignore
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
README.md
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# syntax=docker/dockerfile:1

FROM mcr.microsoft.com/playwright:v1.35.1-jammy

WORKDIR /usr/src/app

# Download dependencies as a separate step to take advantage of Docker's caching.

COPY package.json package-lock.json ./
COPY packages/core/package.json packages/core/package.json
COPY packages/js/package.json packages/js/package.json
COPY packages/node/package.json packages/node/package.json
COPY packages/realtime-api/package.json packages/realtime-api/package.json
COPY packages/swaig/package.json packages/swaig/package.json
COPY packages/web-api/package.json packages/web-api/package.json
COPY packages/webrtc/package.json packages/webrtc/package.json
COPY scripts/sw-build/package.json scripts/sw-build/package.json
COPY scripts/sw-build-all/package.json scripts/sw-build-all/package.json
COPY scripts/sw-common/package.json scripts/sw-common/package.json
COPY scripts/sw-release/package.json scripts/sw-release/package.json
COPY scripts/sw-test/package.json scripts/sw-test/package.json
COPY internal/e2e-js/package.json internal/e2e-js/package.json
COPY internal/e2e-realtime-api/package.json internal/e2e-realtime-api/package.json
COPY internal/playground-js/package.json internal/playground-js/package.json
COPY internal/playground-realtime-api/package.json internal/playground-realtime-api/package.json
COPY internal/playground-swaig/package.json internal/playground-swaig/package.json
COPY internal/stack-tests/package.json internal/stack-tests/package.json

# Leverage a cache mount to /root/.npm to speed up subsequent builds.
RUN --mount=type=cache,target=/root/.npm \
npm ci

COPY . .

RUN npm i && \
npm run build

CMD ["node"]
20 changes: 20 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
e2e-js:
build:
context: .
ipc: host # Using --ipc=host is recommended when using Chrome. Chrome can run out of memory without this flag.
working_dir: /usr/src/app/internal/e2e-js
command: npm run -w=@sw-internal/e2e-js dev -- webrtcCalling.spec.ts
volumes:
- ./:/usr/src/app

e2e-realtime-api:
build:
context: .
ipc: host # Using --ipc=host is recommended when using Chrome. Chrome can run out of memory without this flag.
working_dir: /usr/src/app/internal/e2e-realtime-api
command: npm run -w=@sw-internal/e2e-realtime-api dev # -- chat.test.ts
env_file:
- internal/e2e-realtime-api/.env
volumes:
- ./:/usr/src/app