From ec18cacc6957a1a824e43e556062de20be771ffc Mon Sep 17 00:00:00 2001 From: Dave Earley Date: Wed, 1 May 2024 09:48:05 +0100 Subject: [PATCH] docker fixes --- .../CreateStripeConnectAccountService.php | 28 ------------------- docker/all-in-one/docker-compose.yml | 11 ++++---- docker/all-in-one/nginx/nginx.conf | 20 ++++--------- docker/all-in-one/scripts/startup.sh | 1 - docker/all-in-one/supervisor/supervisord.conf | 2 +- 5 files changed, 12 insertions(+), 50 deletions(-) delete mode 100644 backend/app/Services/Domain/Payment/Stripe/CreateStripeConnectAccountService.php diff --git a/backend/app/Services/Domain/Payment/Stripe/CreateStripeConnectAccountService.php b/backend/app/Services/Domain/Payment/Stripe/CreateStripeConnectAccountService.php deleted file mode 100644 index 537943fe..00000000 --- a/backend/app/Services/Domain/Payment/Stripe/CreateStripeConnectAccountService.php +++ /dev/null @@ -1,28 +0,0 @@ -createStripeConnectAccount(); - } catch (Throwable $e) { - throw new CreateStripeConnectAccountFailedException($e->getMessage()); - } - $stripeAccount = $this->stripe->accounts->create([ - 'type' => 'express', - ]); - - return $stripeAccount->id; - } -} diff --git a/docker/all-in-one/docker-compose.yml b/docker/all-in-one/docker-compose.yml index 4c21fce4..7d0b215e 100644 --- a/docker/all-in-one/docker-compose.yml +++ b/docker/all-in-one/docker-compose.yml @@ -4,10 +4,11 @@ services: build: context: ./../../ dockerfile: Dockerfile.all-in-one - args: - - APP_FRONTEND_URL=http://localhost:8123 - - VITE_API_URL_CLIENT=http://localhost:8123/api - - VITE_API_URL_SERVER=http://localhost:80/api container_name: all-in-one ports: - - "8123:80" \ No newline at end of file + - "8123:80" + environment: + - VITE_FRONTEND_URL=http://localhost:8123 + - VITE_API_URL_CLIENT=http://localhost:8123/api + - VITE_API_URL_SERVER=http://localhost:80/api + - VITE_STRIPE_PUBLISHABLE_KEY=pk_test \ No newline at end of file diff --git a/docker/all-in-one/nginx/nginx.conf b/docker/all-in-one/nginx/nginx.conf index 7764ca73..7344c14e 100644 --- a/docker/all-in-one/nginx/nginx.conf +++ b/docker/all-in-one/nginx/nginx.conf @@ -23,27 +23,17 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } - # Handling API route rewrite and logging location ^~ /api/ { - rewrite ^/api(/.*)$ $1 break; - error_log /dev/stderr notice; - try_files $uri $uri/ @api; - } - - location @api { - rewrite ^ /index.php last; + rewrite ^/api(/.*)$ /index.php$1 break; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param REQUEST_URI $1; # Rewritten URI without /api prefix + fastcgi_pass localhost:9000; } location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - - set $api_uri $request_uri; - if ($request_uri ~ ^/api(/.*)$) { - set $api_uri $1; - } - - fastcgi_param REQUEST_URI $api_uri$is_args$args; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass localhost:9000; fastcgi_index index.php; diff --git a/docker/all-in-one/scripts/startup.sh b/docker/all-in-one/scripts/startup.sh index bf414c59..957ec0ce 100644 --- a/docker/all-in-one/scripts/startup.sh +++ b/docker/all-in-one/scripts/startup.sh @@ -16,5 +16,4 @@ php artisan view:clear chown -R www-data:www-data /app/backend chmod -R 777 /app/backend/storage /app/backend/bootstrap/cache - exec /usr/bin/supervisord -c /etc/supervisord.conf diff --git a/docker/all-in-one/supervisor/supervisord.conf b/docker/all-in-one/supervisor/supervisord.conf index 2f60f5cf..3fd37b42 100644 --- a/docker/all-in-one/supervisor/supervisord.conf +++ b/docker/all-in-one/supervisor/supervisord.conf @@ -34,4 +34,4 @@ stderr_logfile=/dev/stderr redirect_stderr=true stdout_logfile_maxbytes = 0 stderr_logfile_maxbytes = 0 -environment=NODE_ENV="production",VITE_API_URL_CLIENT="%(ENV_VITE_API_URL_CLIENT)s/api",VITE_API_URL_SERVER="http://localhost:80/api",VITE_FRONTEND_URL="%(ENV_VITE_FRONTEND_URL)s",VITE_STRIPE_PUBLISHABLE_KEY="%(ENV_VITE_STRIPE_PUBLISHABLE_KEY)s" +environment=NODE_ENV="production",VITE_API_URL_CLIENT="%(ENV_VITE_API_URL_CLIENT)s",VITE_API_URL_SERVER="http://localhost:80/api",VITE_FRONTEND_URL="%(ENV_VITE_FRONTEND_URL)s",VITE_STRIPE_PUBLISHABLE_KEY="%(ENV_VITE_STRIPE_PUBLISHABLE_KEY)s"