Skip to content

Commit

Permalink
Merge pull request #10874 from nanaya/docker-dusk
Browse files Browse the repository at this point in the history
Fix browser test on docker dev
  • Loading branch information
notbakaneko authored Jan 19, 2024
2 parents 507a0be + cc71081 commit 01720be
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .env.dusk.local.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
APP_KEY=
APP_ENV=testing

APP_URL=http://localhost:8000
NOTIFICATION_ENDPOINT=ws://notification-server-dusk:2345
APP_URL=http://nginx:8008
NOTIFICATION_ENDPOINT=ws://nginx:8008/home/notifications/feed

DB_DATABASE=osu_test
DB_DATABASE_CHAT=osu_chat_test
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ services:
condition: on-failure
shm_size: '2gb' # for chromium

php-dusk:
<<: *x-web
command: ['octane', '--watch']
environment:
<<: *x-env
APP_ENV: dusk.local
OCTANE_STATE_FILE: /tmp/octane-state.json

assets:
<<: *x-web
command: ['watch']
Expand Down Expand Up @@ -136,6 +144,7 @@ services:
image: nginx:latest
depends_on:
- php
- php-dusk
- notification-server
- notification-server-dusk
volumes:
Expand Down
6 changes: 2 additions & 4 deletions docker/development/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export DUSK_WEBDRIVER_BIN=/usr/bin/chromedriver
export YARN_CACHE_FOLDER=/app/.docker/.yarn
export COMPOSER_HOME=/app/.docker/.composer

command=serve
command=octane
if [ "$#" -gt 0 ]; then
command="$1"
shift
Expand Down Expand Up @@ -69,9 +69,7 @@ _test() {
}

_test_browser() {
export APP_ENV=dusk.local
export OCTANE_STATE_FILE=/app/storage/logs/octane-server-state-dusk.json
_rexec ./bin/run_dusk.sh "$@"
_rexec php /app/artisan dusk "$@"
}


Expand Down
54 changes: 29 additions & 25 deletions docker/development/nginx-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ map $http_upgrade $connection_upgrade {
'' close;
}

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
resolver 127.0.0.11 valid=10s;
resolver_timeout 5s;

root /app/public;

root /app/public;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;

resolver 127.0.0.11 valid=10s;
resolver_timeout 5s;
server {
listen 80 default_server;

location / {
try_files $uri @octane;
Expand All @@ -22,30 +27,29 @@ server {

location = /home/notifications/feed {
proxy_pass http://notification-server:2345;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
}

location = /home/notifications/feed-dusk {
location @octane {
proxy_pass http://php:8000;
}
}

server {
listen 8008;

location / {
try_files $uri @octane;
}

location /assets/images/flags/ {
error_page 404 /images/flags/fallback.png;
}

location = /home/notifications/feed {
proxy_pass http://notification-server-dusk:2345;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
}

location @octane {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;

proxy_pass http://php:8000;
proxy_pass http://php-dusk:8000;
}
}

0 comments on commit 01720be

Please sign in to comment.