Skip to content

Commit

Permalink
docker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley committed May 1, 2024
1 parent ac266a7 commit ec18cac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 50 deletions.

This file was deleted.

11 changes: 6 additions & 5 deletions docker/all-in-one/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
- "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
20 changes: 5 additions & 15 deletions docker/all-in-one/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion docker/all-in-one/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docker/all-in-one/supervisor/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit ec18cac

Please sign in to comment.