Skip to content

Commit 629e981

Browse files
committed
fix: add docker host gateway to container hosts
1 parent 0f0020f commit 629e981

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@
44
To build the image run:
55

66
```
7-
docker build -t lowcoder-tests -f docker/Dockerfile docker/ --no-cache
7+
docker build -t lowcoderorg/lowcoder-tests -f docker/Dockerfile docker/ --no-cache
88
```
99

1010
If you need to change the default playwright version (currently v1.45) add build argument to the build:
1111

1212
```
13-
docker build -t lowcoder-tests --build-arg=PLAYWRIGHT_VERSION=1.40 -f docker/Dockerfile docker/ --no-cache
13+
docker build -t lowcoderorg/lowcoder-tests --build-arg=PLAYWRIGHT_VERSION=1.40 -f docker/Dockerfile docker/ --no-cache
1414
```
1515

1616
### Running tests
1717

1818
**Using --ipc=host is recommended when using Chrome (Docker docs). Chrome can run out of memory without this flag.**
1919

2020
```
21-
docker run -it --rm --ipc=host -v ./playwright:/app lowcoder-tests
21+
docker run -it --rm --ipc=host -v ./playwright:/app lowcoderorg/lowcoder-tests
2222
```
2323

2424
To configure to which lowcoder instance playwright is connecting, set `LOWCODER_BASE_URL` in `playwright/.env` file.
25-
Please be aware that when run with docker, localhost is translated to the actual container, so set IP address of your host if lowcoder is running on your host.
25+
Please be aware that when run with docker, localhost is translated to the actual container, so set IP address of your host if lowcoder is running on your host.
26+
By default when run with docker, it connects to your host on port 3000.
2627

2728
Once tests are finished, you can find html reposrts and videos in `playwright/report` folder.
2829

docker/entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

3+
echo "172.17.0.1 lowcoder.internal" >> /etc/hosts
4+
35
if [ "$(id -u)" = "0" ]; then
4-
echo "Running as root, dropping privileges..."
6+
echo "Dropping privileges to user playwright..."
57
TESTS_UID=`ls -n /app/tests | tail -1 | cut -f3 -d' '`
68
TESTS_GID=`ls -n /app/tests | tail -1 | cut -f4 -d' '`
79
PUID=`id playwright -u`
@@ -20,7 +22,9 @@ fi;
2022

2123
cd /app
2224
if [ ! -e "/app/node_modules" ]; then
25+
echo "Installing required node modules..."
2326
gosu playwright npm install
2427
fi;
2528

29+
echo "Running tests..."
2630
gosu playwright npx playwright test

playwright/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LOWCODER_BASE_URL=http://192.168.0.50:3003
1+
LOWCODER_BASE_URL=http://lowcoder.internal:3000

0 commit comments

Comments
 (0)