2024-04-12 08:28:40 +00:00
< div x - data = " { initLoadingCompose: $wire .entangle('initLoadingCompose') } " >
2024-04-12 09:11:55 +00:00
< form wire : submit = 'submit' class = " flex flex-col pb-32 " >
2023-06-02 10:34:45 +00:00
< div class = " flex items-center gap-2 " >
< h2 > General </ h2 >
2023-05-25 12:05:44 +00:00
< x - forms . button type = " submit " >
2023-05-18 11:26:35 +00:00
Save
2024-04-25 09:49:34 +00:00
</ x - forms . button >
2023-05-18 11:26:35 +00:00
</ div >
2023-10-18 09:20:40 +00:00
< div > General configuration for your application .</ div >
2023-05-31 08:19:29 +00:00
< div class = " flex flex-col gap-2 py-4 " >
2023-05-22 09:21:03 +00:00
< div class = " flex flex-col items-end gap-2 xl:flex-row " >
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " id = " application.name " label = " Name " required />
< x - forms . input x - bind : disabled = " initLoadingCompose " id = " application.description " label = " Description " />
2023-05-18 11:26:35 +00:00
</ div >
2024-01-10 10:07:53 +00:00
2023-11-24 14:48:23 +00:00
@ if ( ! $application -> dockerfile && $application -> build_pack !== 'dockerimage' )
2023-10-06 11:46:42 +00:00
< div class = " flex flex-col gap-2 " >
< div class = " flex gap-2 " >
2024-04-12 08:28:40 +00:00
< x - forms . select x - bind : disabled = " initLoadingCompose " wire : model . live = " application.build_pack "
label = " Build Pack " required >
2023-10-06 11:46:42 +00:00
< option value = " nixpacks " > Nixpacks </ option >
2023-11-10 10:33:15 +00:00
< option value = " static " > Static </ option >
2023-10-06 11:46:42 +00:00
< option value = " dockerfile " > Dockerfile </ option >
2023-11-24 14:48:23 +00:00
< option value = " dockercompose " > Docker Compose </ option >
2023-10-06 11:46:42 +00:00
</ x - forms . select >
2023-11-10 10:33:15 +00:00
@ if ( $application -> settings -> is_static || $application -> build_pack === 'static' )
2023-10-06 11:46:42 +00:00
< x - forms . select id = " application.static_image " label = " Static Image " required >
< option value = " nginx:alpine " > nginx : alpine </ option >
< option disabled value = " apache:alpine " > apache : alpine </ option >
</ x - forms . select >
@ endif
</ div >
@ if ( $application -> could_set_build_commands ())
< div class = " w-64 " >
2023-11-20 12:49:10 +00:00
< x - forms . checkbox instantSave id = " application.settings.is_static "
label = " Is it a static site? "
2023-10-06 11:46:42 +00:00
helper = " If your application is a static site or the final build assets should be served as a static site, enable this. " />
</ div >
@ endif
2023-11-27 13:28:21 +00:00
@ if ( $application -> build_pack === 'dockercompose' )
2024-01-02 12:55:35 +00:00
@ if ( count ( $parsedServices ) > 0 && ! $application -> settings -> is_raw_compose_deployment_enabled )
2024-04-25 09:49:34 +00:00
< h3 class = " pt-6 " > Domains </ h3 >
2023-11-27 13:28:21 +00:00
@ foreach ( data_get ( $parsedServices , 'services' ) as $serviceName => $service )
@ if ( ! isDatabaseImage ( data_get ( $service , 'image' )))
< div class = " flex items-end gap-2 " >
< x - forms . input
2024-04-18 16:20:51 +00:00
helper = " You can specify one domain with path or more with comma. You can specify a port to bind the domain to.<br><br><span class='text-helper'>Example</span><br>- http://app.coolify.io,https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3<br>- http://app.coolify.io:3000 -> app.coolify.io will point to port 3000 inside the container. "
2023-11-27 13:28:21 +00:00
label = " Domains for { { str( $serviceName )->headline() }} "
id = " parsedServiceDomains. { { $serviceName }}.domain " ></ x - forms . input >
2024-04-08 10:15:44 +00:00
< x - forms . button wire : click = " generateDomain(' { { $serviceName }}') " > Generate
Domain </ x - forms . button >
2023-11-27 13:28:21 +00:00
</ div >
@ endif
@ endforeach
@ endif
@ endif
2023-09-24 19:38:11 +00:00
</ div >
@ endif
2024-01-10 10:07:53 +00:00
@ if ( $application -> build_pack !== 'dockercompose' )
2024-01-16 14:19:14 +00:00
< div class = " flex items-end gap-2 " >
< x - forms . input placeholder = " https://coolify.io " id = " application.fqdn " label = " Domains "
2024-04-18 16:20:51 +00:00
helper = " You can specify one domain with path or more with comma. You can specify a port to bind the domain to.<br><br><span class='text-helper'>Example</span><br>- http://app.coolify.io,https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3<br>- http://app.coolify.io:3000 -> app.coolify.io will point to port 3000 inside the container. " />
2024-01-16 14:19:14 +00:00
< x - forms . button wire : click = " getWildcardDomain " > Generate Domain
</ x - forms . button >
</ div >
@ endif
2024-03-25 18:07:59 +00:00
2023-12-04 10:41:44 +00:00
@ if ( $application -> build_pack !== 'dockercompose' )
2024-01-18 11:05:48 +00:00
< div class = " flex items-center gap-2 pt-8 " >
2024-01-18 10:40:13 +00:00
< h3 > Docker Registry </ h3 >
@ if ( $application -> build_pack !== 'dockerimage' && ! $application -> destination -> server -> isSwarm ())
< x - helper
2024-03-27 10:07:29 +00:00
helper = " Push the built image to a docker registry. More info <a class='underline' href='https://coolify.io/docs/knowledge-base/docker/registry' target='_blank'>here</a>. " />
2024-01-18 10:40:13 +00:00
@ endif
</ div >
2023-11-28 17:31:04 +00:00
@ if ( $application -> destination -> server -> isSwarm ())
2023-12-18 13:01:25 +00:00
@ if ( $application -> build_pack !== 'dockerimage' )
< div > Docker Swarm requires the image to be available in a registry . More info < a
2024-03-27 10:07:29 +00:00
class = " underline " href = " https://coolify.io/docs/knowledge-base/docker/registry "
2023-12-18 13:01:25 +00:00
target = " _blank " > here </ a >.</ div >
@ endif
2023-11-28 17:31:04 +00:00
@ endif
2023-11-24 14:48:23 +00:00
< div class = " flex flex-col gap-2 xl:flex-row " >
@ if ( $application -> build_pack === 'dockerimage' )
2023-11-28 17:31:04 +00:00
@ if ( $application -> destination -> server -> isSwarm ())
< x - forms . input required id = " application.docker_registry_image_name " label = " Docker Image " />
< x - forms . input id = " application.docker_registry_image_tag " label = " Docker Image Tag " />
@ else
< x - forms . input id = " application.docker_registry_image_name " label = " Docker Image " />
< x - forms . input id = " application.docker_registry_image_tag " label = " Docker Image Tag " />
@ endif
2023-11-24 14:48:23 +00:00
@ else
2024-03-01 10:43:42 +00:00
@ if (
$application -> destination -> server -> isSwarm () ||
$application -> additional_servers -> count () > 0 ||
$application -> settings -> is_build_server_enabled )
< x - forms . input id = " application.docker_registry_image_name " required label = " Docker Image "
placeholder = " Required! " />
2023-11-28 17:31:04 +00:00
< x - forms . input id = " application.docker_registry_image_tag "
helper = " If set, it will tag the built image with this tag too. <br><br>Example: If you set it to 'latest', it will push the image with the commit sha tag + with the latest tag. "
2024-03-01 10:43:42 +00:00
placeholder = " Empty means latest will be used. " label = " Docker Image Tag " />
2023-11-28 17:31:04 +00:00
@ else
< x - forms . input id = " application.docker_registry_image_name "
helper = " Empty means it won't push the image to a docker registry. "
placeholder = " Empty means it won't push the image to a docker registry. "
label = " Docker Image " />
< x - forms . input id = " application.docker_registry_image_tag "
placeholder = " Empty means only push commit sha tag. "
helper = " If set, it will tag the built image with this tag too. <br><br>Example: If you set it to 'latest', it will push the image with the commit sha tag + with the latest tag. "
label = " Docker Image Tag " />
@ endif
2023-11-24 14:48:23 +00:00
@ endif
</ div >
@ endif
2023-10-06 11:46:42 +00:00
2023-10-10 09:16:38 +00:00
@ if ( $application -> build_pack !== 'dockerimage' )
2024-01-18 11:05:48 +00:00
< h3 class = " pt-8 " > Build </ h3 >
@ if ( $application -> build_pack !== 'dockercompose' )
2024-05-05 16:33:52 +00:00
< div class = " max-w-96 " >
2024-01-18 11:05:48 +00:00
< x - forms . checkbox
2024-03-27 10:07:29 +00:00
helper = " Use a build server to build your application. You can configure your build server in the Server settings. This is experimental. For more info, check the <a href='https://coolify.io/docs/knowledge-base/server/build-server' class='underline' target='_blank'>documentation</a>. "
2024-01-18 11:05:48 +00:00
instantSave id = " application.settings.is_build_server_enabled "
label = " Use a Build Server? (experimental) " />
</ div >
@ endif
2023-10-10 09:16:38 +00:00
@ if ( $application -> could_set_build_commands ())
2023-11-06 11:40:53 +00:00
@ if ( $application -> build_pack === 'nixpacks' )
< div class = " flex flex-col gap-2 xl:flex-row " >
2023-11-06 16:25:54 +00:00
< x - forms . input placeholder = " If you modify this, you probably need to have a nixpacks.toml "
id = " application.install_command " label = " Install Command " />
< x - forms . input placeholder = " If you modify this, you probably need to have a nixpacks.toml "
id = " application.build_command " label = " Build Command " />
< x - forms . input placeholder = " If you modify this, you probably need to have a nixpacks.toml "
id = " application.start_command " label = " Start Command " />
2023-11-06 11:40:53 +00:00
</ div >
2024-04-03 11:03:13 +00:00
< div class = " pb-4 text-xs " > Nixpacks will detect the required configuration automatically .
2024-03-28 14:05:12 +00:00
< a class = " underline " href = " https://coolify.io/docs/resources/introduction " > Framework
Specific Docs </ a >
2024-01-18 11:05:48 +00:00
</ div >
2023-11-06 11:40:53 +00:00
@ endif
2023-10-10 09:16:38 +00:00
@ endif
2023-12-17 19:56:12 +00:00
@ if ( $application -> build_pack === 'dockercompose' )
2024-04-12 08:28:40 +00:00
< div class = " flex flex-col gap-2 " x - init = " $wire .dispatch('loadCompose', true) " >
2023-12-17 19:56:12 +00:00
< div class = " flex gap-2 " >
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " placeholder = " / "
id = " application.base_directory " label = " Base Directory "
2023-12-17 19:56:12 +00:00
helper = " Directory to use as root. Useful for monorepos. " />
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " placeholder = " /docker-compose.yaml "
id = " application.docker_compose_location " label = " Docker Compose Location "
2024-03-25 09:41:44 +00:00
helper = " It is calculated together with the Base Directory:<br><span class='dark:text-warning'> { { Str::start( $application->base_directory . $application->docker_compose_location , '/') }}</span> " />
2023-12-17 19:56:12 +00:00
</ div >
2023-12-18 13:01:25 +00:00
< div class = " pt-4 " > The following commands are for advanced use cases . Only modify them if you
know what are
2023-12-17 19:56:12 +00:00
you doing .</ div >
< div class = " flex gap-2 " >
2024-04-12 08:28:40 +00:00
< x - forms . input placeholder = " docker compose build " x - bind : disabled = " initLoadingCompose "
2023-12-17 19:56:12 +00:00
id = " application.docker_compose_custom_build_command "
2024-03-25 09:41:44 +00:00
helper = " If you use this, you need to specify paths relatively and should use the same compose file in the custom command, otherwise the automatically configured labels / etc won't work.<br><br>So in your case, use: <span class='dark:text-warning'>docker compose -f . { { Str::start( $application->base_directory . $application->docker_compose_location , '/') }} build</span> "
2023-12-17 19:56:12 +00:00
label = " Custom Build Command " />
2024-04-12 08:28:40 +00:00
< x - forms . input placeholder = " docker compose up -d " x - bind : disabled = " initLoadingCompose "
2023-12-17 19:56:12 +00:00
id = " application.docker_compose_custom_start_command "
2024-03-25 09:41:44 +00:00
helper = " If you use this, you need to specify paths relatively and should use the same compose file in the custom command, otherwise the automatically configured labels / etc won't work.<br><br>So in your case, use: <span class='dark:text-warning'>docker compose -f . { { Str::start( $application->base_directory . $application->docker_compose_location , '/') }} up -d</span> "
2023-12-17 19:56:12 +00:00
label = " Custom Start Command " />
{{ -- < x - forms . input placeholder = " /docker-compose.yaml " id = " application.docker_compose_pr_location "
label = " Docker Compose Location For Pull Requests "
2024-03-25 09:41:44 +00:00
helper = " It is calculated together with the Base Directory:<br><span class='dark:text-warning'> { { Str::start( $application->base_directory . $application->docker_compose_pr_location , '/') }}</span> " /> -- }}
2023-12-17 19:56:12 +00:00
</ div >
</ div >
@ else
< div class = " flex flex-col gap-2 xl:flex-row " >
< x - forms . input placeholder = " / " id = " application.base_directory " label = " Base Directory "
helper = " Directory to use as root. Useful for monorepos. " />
@ if ( $application -> build_pack === 'dockerfile' && ! $application -> dockerfile )
< x - forms . input placeholder = " /Dockerfile " id = " application.dockerfile_location "
label = " Dockerfile Location "
2024-03-25 09:41:44 +00:00
helper = " It is calculated together with the Base Directory:<br><span class='dark:text-warning'> { { Str::start( $application->base_directory . $application->dockerfile_location , '/') }}</span> " />
2023-10-10 09:16:38 +00:00
@ endif
2023-12-17 19:56:12 +00:00
@ if ( $application -> build_pack === 'dockerfile' )
< x - forms . input id = " application.dockerfile_target_build " label = " Docker Build Stage Target "
helper = " Useful if you have multi-staged dockerfile. " />
@ endif
@ if ( $application -> could_set_build_commands ())
@ if ( $application -> settings -> is_static )
< x - forms . input placeholder = " /dist " id = " application.publish_directory "
label = " Publish Directory " required />
@ else
< x - forms . input placeholder = " / " id = " application.publish_directory "
label = " Publish Directory " />
@ endif
@ endif
2024-03-28 14:05:12 +00:00
2023-12-17 19:56:12 +00:00
</ div >
2024-04-03 11:03:13 +00:00
@ if ( $this -> application -> is_github_based () && ! $this -> application -> is_public_repository ())
2024-04-08 10:15:44 +00:00
< div class = " pb-4 " >
< x - forms . textarea helper = " Gitignore-style rules to filter Git based webhook deployments. "
placeholder = " src/pages/** " id = " application.watch_paths " label = " Watch Paths " />
</ div >
2024-03-28 14:05:12 +00:00
@ endif
2024-01-29 15:07:00 +00:00
< x - forms . input
2024-03-27 10:07:29 +00:00
helper = " You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/docker/custom-commands'>docs.</a> "
2024-01-29 15:07:00 +00:00
placeholder = " --cap-add SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined --ulimit nofile=1024:1024 --tmpfs /run:rw,noexec,nosuid,size=65536k "
id = " application.custom_docker_run_options " label = " Custom Docker Options " />
2023-12-17 19:56:12 +00:00
@ endif
2024-03-04 12:39:34 +00:00
@ else
2024-03-13 13:41:31 +00:00
< x - forms . input
2024-03-27 10:07:29 +00:00
helper = " You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/docker/custom-commands'>docs.</a> "
2024-03-13 13:41:31 +00:00
placeholder = " --cap-add SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined --ulimit nofile=1024:1024 --tmpfs /run:rw,noexec,nosuid,size=65536k "
id = " application.custom_docker_run_options " label = " Custom Docker Options " />
2023-10-07 10:54:19 +00:00
@ endif
2023-11-24 14:48:23 +00:00
@ if ( $application -> build_pack === 'dockercompose' )
2024-04-12 08:28:40 +00:00
< x - forms . button wire : target = 'initLoadingCompose'
x - on : click = " $wire .dispatch('loadCompose', false) " > Reload Compose File </ x - forms . button >
2024-01-02 12:55:35 +00:00
@ if ( $application -> settings -> is_raw_compose_deployment_enabled )
< x - forms . textarea rows = " 10 " readonly id = " application.docker_compose_raw "
2024-01-16 14:19:14 +00:00
label = " Docker Compose Content (applicationId: { { $application->id }}) "
helper = " You need to modify the docker compose file. " />
2024-01-02 12:55:35 +00:00
@ else
< x - forms . textarea rows = " 10 " readonly id = " application.docker_compose "
label = " Docker Compose Content " helper = " You need to modify the docker compose file. " />
@ endif
2024-05-15 15:52:14 +00:00
< div class = " w-72 " >
< x - forms . checkbox label = " Escape special characters in labels? "
helper = " By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $ $ .<br><br>If you want to use env variables inside the labels, turn this off. "
id = " application.settings.is_container_label_escape_enabled " instantSave ></ x - forms . checkbox >
</ div >
2023-11-28 09:11:53 +00:00
{{ -- < x - forms . textarea rows = " 10 " readonly id = " application.docker_compose_pr "
label = " Docker PR Compose Content " helper = " You need to modify the docker compose file. " /> -- }}
2023-11-24 14:48:23 +00:00
@ endif
2023-10-07 10:54:19 +00:00
2023-08-11 20:41:47 +00:00
@ if ( $application -> dockerfile )
< x - forms . textarea label = " Dockerfile " id = " application.dockerfile " rows = " 6 " > </ x - forms . textarea >
@ endif
2023-11-24 14:48:23 +00:00
@ if ( $application -> build_pack !== 'dockercompose' )
2024-01-18 11:05:48 +00:00
< h3 class = " pt-8 " > Network </ h3 >
2023-11-24 14:48:23 +00:00
< div class = " flex flex-col gap-2 xl:flex-row " >
@ if ( $application -> settings -> is_static || $application -> build_pack === 'static' )
< x - forms . input id = " application.ports_exposes " label = " Ports Exposes " readonly />
@ else
< x - forms . input placeholder = " 3000,3001 " id = " application.ports_exposes " label = " Ports Exposes "
required
helper = " A comma separated list of ports your application uses. The first port will be used as default healthcheck port if nothing defined in the Healthcheck menu. Be sure to set this correctly. " />
@ endif
2023-12-18 13:01:25 +00:00
@ if ( ! $application -> destination -> server -> isSwarm ())
< x - forms . input placeholder = " 3000:3000 " id = " application.ports_mappings " label = " Ports Mappings "
2024-03-25 09:41:44 +00:00
helper = " A comma separated list of ports you would like to map to the host system. Useful when you do not want to use domains.<br><br><span class='inline-block font-bold dark:text-warning'>Example:</span><br>3000:3000,3002:3002<br><br>Rolling update is not supported if you have a port mapped to the host. " />
2023-12-18 13:01:25 +00:00
@ endif
2023-11-24 14:48:23 +00:00
</ div >
< x - forms . textarea label = " Container Labels " rows = " 15 " id = " customLabels " ></ x - forms . textarea >
2024-05-15 15:52:14 +00:00
< div class = " w-72 " >
< x - forms . checkbox label = " Escape special characters in labels? "
helper = " By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $ $ .<br><br>If you want to use env variables inside the labels, turn this off. "
id = " application.settings.is_container_label_escape_enabled " instantSave ></ x - forms . checkbox >
</ div >
< x - modal - confirmation buttonFullWidth action = " resetDefaultLabels "
buttonTitle = " Reset to Coolify Generated Labels " >
Are you sure you want to reset the labels to Coolify generated labels ? < br > It could break the proxy
configuration after you restart the container .
2024-05-06 10:52:06 +00:00
</ x - modal - confirmation >
2023-11-24 14:48:23 +00:00
@ endif
2024-02-08 09:27:43 +00:00
2024-03-13 13:41:31 +00:00
< h3 class = " pt-8 " > Pre / Post Deployment Commands </ h3 >
2024-02-08 10:02:30 +00:00
< div class = " flex flex-col gap-2 xl:flex-row " >
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " id = " application.pre_deployment_command "
label = " Pre-deployment Command "
2024-03-13 13:41:31 +00:00
helper = " An optional script or command to execute in the existing container before the deployment begins. " />
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " id = " application.pre_deployment_command_container "
label = " Container Name "
2024-03-13 13:41:31 +00:00
helper = " The name of the container to execute within. You can leave it blank if your application only has one container. " />
2024-02-08 10:02:30 +00:00
</ div >
2024-02-08 09:27:43 +00:00
< div class = " flex flex-col gap-2 xl:flex-row " >
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " placeholder = " php artisan migrate "
id = " application.post_deployment_command " label = " Post-deployment Command "
2024-03-13 13:41:31 +00:00
helper = " An optional script or command to execute in the newly built container after the deployment completes. " />
2024-04-12 08:28:40 +00:00
< x - forms . input x - bind : disabled = " initLoadingCompose " id = " application.post_deployment_command_container "
label = " Container Name "
2024-03-13 13:41:31 +00:00
helper = " The name of the container to execute within. You can leave it blank if your application only has one container. " />
2024-02-08 09:27:43 +00:00
</ div >
2023-05-18 11:26:35 +00:00
</ div >
2023-04-19 10:42:15 +00:00
</ form >
2024-04-12 08:28:40 +00:00
@ script
< script >
$wire . $on ( 'loadCompose' , ( isInit = true ) => {
$wire . initLoadingCompose = true ;
$wire . loadComposeFile ( isInit );
});
</ script >
@ endscript
2023-04-19 10:42:15 +00:00
</ div >