diff --git a/src/lib/buildPacks/common.ts b/src/lib/buildPacks/common.ts index 4e2ccf539..1bdf75656 100644 --- a/src/lib/buildPacks/common.ts +++ b/src/lib/buildPacks/common.ts @@ -207,75 +207,6 @@ export async function copyBaseConfigurationFiles( } } - ` - ); - } else if (buildPack === 'laravel') { - await fs.writeFile( - `${workdir}/nginx.conf`, - `user nginx; - worker_processes auto; - - error_log /docker.stdout; - pid /run/nginx.pid; - - events { - worker_connections 1024; - } - - http { - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /docker.stdout main; - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - server { - listen 80; - server_name _; - disable_symlinks off; - - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Content-Type-Options "nosniff"; - - root /app/public; - index index.html index.htm index.php; - - charset utf-8; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - location = /favicon.ico { access_log off; log_not_found off; } - location = /robots.txt { access_log off; log_not_found off; } - - error_page 404 /index.php; - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - if (!-f $document_root$fastcgi_script_name) { - return 404; - } - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - location ~ /\.(?!well-known).* { - deny all; - } - } - } ` ); } diff --git a/src/lib/buildPacks/laravel.ts b/src/lib/buildPacks/laravel.ts index 61c2d7f6e..bf5fcc6a2 100644 --- a/src/lib/buildPacks/laravel.ts +++ b/src/lib/buildPacks/laravel.ts @@ -2,13 +2,13 @@ import { buildCacheImageForLaravel, buildImage } from '$lib/docker'; import { promises as fs } from 'fs'; const createDockerfile = async (data, image): Promise => { - const { workdir, applicationId, tag } = data; + const { workdir, applicationId, tag, baseImage } = data; const Dockerfile: Array = []; Dockerfile.push(`FROM ${image}`); Dockerfile.push(`LABEL coolify.image=true`); Dockerfile.push('WORKDIR /app'); - Dockerfile.push(`COPY /nginx.conf /etc/nginx/nginx.conf`); + Dockerfile.push(`ENV WEB_DOCUMENT_ROOT /app/public`); Dockerfile.push(`COPY --chown=application:application composer.* ./`); Dockerfile.push(`COPY --chown=application:application database/ database/`); Dockerfile.push( diff --git a/src/lib/components/svg/applications/Laravel.svelte b/src/lib/components/svg/applications/Laravel.svelte new file mode 100644 index 000000000..ab544a596 --- /dev/null +++ b/src/lib/components/svg/applications/Laravel.svelte @@ -0,0 +1,10 @@ +Logomark diff --git a/src/routes/applications/index.svelte b/src/routes/applications/index.svelte index 3295b8eeb..07e4564c5 100644 --- a/src/routes/applications/index.svelte +++ b/src/routes/applications/index.svelte @@ -22,6 +22,7 @@ import Astro from '$lib/components/svg/applications/Astro.svelte'; import Eleventy from '$lib/components/svg/applications/Eleventy.svelte'; import Deno from '$lib/components/svg/applications/Deno.svelte'; + import Laravel from '$lib/components/svg/applications/Laravel.svelte'; async function newApplication() { const { id } = await post('/applications/new', {}); @@ -104,6 +105,8 @@ {:else if application.buildPack.toLowerCase() === 'deno'} + {:else if application.buildPack.toLowerCase() === 'laravel'} + {/if} {/if} @@ -162,6 +165,8 @@ {:else if application.buildPack.toLowerCase() === 'deno'} + {:else if application.buildPack.toLowerCase() === 'laravel'} + {/if} {/if}