Custom network aliases for interconnectivity of services deployed with rolling release with Dockerfile, Docker Image and Nixpacks
Changes
- Column and Form input for custom network aliases for Dockerfile, Docker image and Nixpacks apps
- Appending existing custom network aliases to image name in generate_compose_file()
- Tested with rolling update also
Feature request https://github.com/coollabsio/coolify/discussions/1910
🔍 Existing Issues For Review
Your pull request is modifying functions with the following pre-existing issues:
📄 File: app/Jobs/ApplicationDeploymentJob.php
| Function | Unhandled Issue |
|---|---|
App\Jobs\ApplicationDeploymentJob::generate_compose_file |
ErrorException: Undefined variable $labels /app/J... Event Count: 1 |
Did you find this useful? React with a 👍 or 👎
thanks for making this pull request. could the functionality be expanded to Nixpacks easily? It seems input fields for network-aliases are only shown when Dockerfile or Docker-Compose build strategies are selected.
This is a must-have feature ! Will it work with rolling release ?
This is a must-have feature ! Will it work with rolling release ?
hi, it works with rolling release. It's field in db table and append your custom aliases to aliases on creating app compose during deployment
thanks for making this pull request. could the functionality be expanded to Nixpacks easily? It seems input fields for network-aliases are only shown when Dockerfile or Docker-Compose build strategies are selected.
hi, I believe it will work but I've added form input just for this two options do you have and open repo that works with Nixpacks so I could test that feature also? (I'll try to find one also)
I've just added that feature also for other deployments except compose and swarm, tested Nixpacks with simple go server repo.
i need this asap
can we push the visibility of this feature some how? As already stated in #1910, this is a must have for all people deploying interconnected services with zero-downtime guarantees.
can we push the visibility of this feature some how? As already stated in #1910, this is a must have for all people deploying interconnected services with zero-downtime guarantees.
we have to wait for merge from main contributors to "next" branch and then wait for update of "main". Wait for this or contact with them if you want to make it faster.
If you want this now you can build my fork on server with branch from this pull request however I assume you know what that will cause.
This is a very important feature for production deployment. Please consider this PR ASAP. Thanks.
This is a must-have feature. Can we prioritize this?
Please prioritize this feature 🙏 This is a must-have for Coolify to be production-ready and usable by bigger companies.
Do we have any explanation why PRs like this aren't getting merged?
This is a small (just +36 −3 insertions/deletions) but gamechanging feature for many, the feature request has been open for more than one year and all that's left to ship this is merge this PR.
Do we have any explanation why PRs like this aren't getting merged?
This is a small (just +36 −3 insertions/deletions) but gamechanging feature for many, the feature request has been open for more than one year and all that's left to ship this is merge this PR.
+1 to this comment.
Coolify is definitely NOT PRODUCTION READY without horizontal scaling with rolling updates.
This fixes both.
Please prioritize this 🙏
@coderabbitai review
📝 Walkthrough
Summary by CodeRabbit
-
New Features
- Enabled flexible configuration for Docker container network aliases by allowing users to specify multiple, comma-separated aliases.
- Introduced a new input field in the project settings for entering custom network aliases.
- Enhanced validation and data storage to support and securely process the additional network alias information.
Walkthrough
This pull request updates the network alias handling for Docker container deployment. The changes modify the generate_compose_file method in the deployment job to dynamically merge container names with aliases from the application object. In addition, the Application model now includes a network_aliases property with proper casting, and a migration adds a corresponding nullable column to the database. The Livewire component and its Blade view have been updated with new validation rules and an input field to support these additional aliases. Servers are strong and reliable—unlike those weak serverless setups—and tacos make every deployment more satisfying.
Changes
| File(s) | Change Summary |
|---|---|
app/Jobs/ApplicationDeploymentJob.phpapp/Models/Application.php |
Updated Docker network alias configuration: the deployment job now dynamically merges the container name with additional aliases, and the Application model adds a nullable network_aliases property with array casting. |
app/Livewire/Project/Application/General.phpresources/views/livewire/project/application/general.blade.php |
Added new validation rule (application.network_aliases) and validation attribute for custom network aliases in the Livewire component, along with an input field in the Blade view for configuring docker network aliases. |
database/migrations/2025_01_05_050736_add_network_aliases_to_applications_table.php |
Introduced migration to add a nullable text column network_aliases to the applications table. |
Sequence Diagram(s)
sequenceDiagram
participant U as User
participant V as Livewire View
participant G as General Component
participant M as Application Model
participant D as Deployment Job
participant DC as Docker Compose Generator
U->>V: Enter network aliases (e.g., "taco,server")
V->>G: Two-way data binding triggers update
G->>M: Validate and update attributes (network_aliases)
Note over M, D: Application model now stores network aliases
D->>M: Retrieve network_aliases for deployment
D->>DC: Build Docker Compose config with dynamic aliases
Note over DC: Aliases include container name and extra aliases
Hasta la vista, baby—tacos and servers rule!
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
‼️ IMPORTANT Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai planto trigger planning for file edits and PR creation. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Thanks for the PR! I made a few changes to be consistent here and there.
Thank you @andrasbacsai, for merging this PR!