coolify/CONTRIBUTING.md

141 lines
5.8 KiB
Markdown
Raw Normal View History

2024-08-26 14:35:51 +02:00
# Contributing
2024-08-26 14:57:28 +02:00
> "First, thanks for considering contributing to my project. It really means a lot!" - [@andrasbacsai](https://github.com/andrasbacsai)
2024-08-26 14:35:51 +02:00
2024-08-26 21:39:40 +02:00
You can ask for guidance anytime on our [Discord server](https://coollabs.io/discord) in the `#contribute` channel.
2024-08-26 14:35:51 +02:00
2024-08-26 14:57:28 +02:00
2024-08-26 14:35:51 +02:00
## Code Contribution
2024-08-26 15:44:30 +02:00
## 1. Setup your development environment
2024-08-26 14:35:51 +02:00
Follow the steps below for your operating system:
2024-08-26 15:44:30 +02:00
### Windows
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
1. Install `docker-ce`, Docker Desktop (or similar):
- Docker CE (recommended):
- Follow the instructions to install WSL2, Ubuntu and on that install `docker-ce` from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-windows#install-windows-subsystem-linux-v2-wsl2)
- Install Docker Desktop (easier):
- Download and install [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
- Ensure WSL2 backend is enabled in Docker Desktop settings
2024-08-26 14:35:51 +02:00
2. Install Spin:
2024-08-26 21:59:58 +02:00
- Follow the instructions to install Spin on Windows from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-windows#download-and-install-spin-into-wsl2)
2024-08-26 14:35:51 +02:00
2024-08-26 15:44:30 +02:00
### MacOS
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
1. Install Orbstack, Docker Desktop (or similar):
- Orbstack (recommended, as it is a faster and lighter alternative to Docker Desktop):
2024-08-26 14:35:51 +02:00
- Download and install [Orbstack](https://docs.orbstack.dev/quick-start#installation)
- Docker Desktop:
- Download and install [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/)
2. Install Spin:
2024-08-26 21:38:20 +02:00
- Follow the instructions to install Spin on MacOS from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-macos/#download-and-install-spin)
2024-08-26 14:35:51 +02:00
2024-08-26 15:44:30 +02:00
### Linux
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
1. Install Docker Engine, Docker Desktop (or similar):
- Docker Engine (recommended, as there is no VM overhead):
2024-08-26 14:35:51 +02:00
- Follow the official [Docker Engine installation guide](https://docs.docker.com/engine/install/) for your Linux distribution
- Docker Desktop:
2024-08-26 14:57:28 +02:00
- If you want a GUI, you can use [Docker Desktop for Linux](https://docs.docker.com/desktop/install/linux-install/)
2024-08-26 14:35:51 +02:00
2. Install Spin:
2024-08-26 21:38:20 +02:00
- Follow the instructions to install Spin on Linux from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-linux#configure-docker-permissions)
2024-08-26 14:35:51 +02:00
2024-08-26 14:57:28 +02:00
2024-08-26 21:59:58 +02:00
## 2. Verify installation (optional)
2024-08-26 14:35:51 +02:00
After installing Docker (or Orbstack) and Spin, verify the installation:
1. Open a terminal or command prompt
2. Run the following commands:
```bash
docker --version
spin --version
```
You should see version information for both Docker and Spin.
2024-08-26 14:57:28 +02:00
2024-08-26 21:59:58 +02:00
## 3. Fork the Coolify repository and setup your local repository
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
1. Fork the [Coolify](https://github.com/coollabsio/coolify) repository to your GitHub account.
2024-08-26 14:35:51 +02:00
2024-08-26 21:38:20 +02:00
2. Install a code editor on your machine (below are some popular choices, choose one):
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
- Visual Studio Code (recommended free):
2024-08-26 15:44:30 +02:00
- Windows/macOS/Linux: Download and install from [https://code.visualstudio.com/download](https://code.visualstudio.com/download)
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
- Cursor (recommended but paid for getting the full benefits):
2024-08-26 21:38:20 +02:00
- Windows/macOS/Linux: Download and install from [https://www.cursor.com/](https://www.cursor.com/)
2024-08-26 14:35:51 +02:00
- Zed (very fast code editor):
2024-08-26 15:44:30 +02:00
- macOS/Linux: Download and install from [https://zed.dev/download](https://zed.dev/download)
2024-08-26 14:35:51 +02:00
- Windows: Not available yet
2024-08-26 21:59:58 +02:00
3. Clone the Coolify Repository from your fork to your local machine
2024-08-26 14:57:28 +02:00
- Use `git clone` in the command line
2024-08-26 14:35:51 +02:00
- Use GitHub Desktop (recommended):
2024-08-26 14:57:28 +02:00
- Download and install from [https://desktop.github.com/](https://desktop.github.com/)
2024-08-26 21:59:58 +02:00
- Open GitHub Desktop and login with your GitHub account
- Click on `File` -> `Clone Repository` select `github.com` as the repository location, then select your forked Coolify repository, choose the local path and then click `Clone`
2024-08-26 14:57:28 +02:00
4. Open the cloned Coolify Repository in your chosen code editor.
2024-08-26 14:35:51 +02:00
2024-08-26 15:44:30 +02:00
## 4. Set up Environment Variables
2024-08-26 14:35:51 +02:00
2024-08-26 21:59:58 +02:00
1. In the Code Editor, locate the `.env.development.example` file in the root directory of your local Coolify repository.
2024-08-26 14:35:51 +02:00
2024-08-26 21:38:20 +02:00
2. Duplicate the `.env.development.example` file and rename the copy to `.env`.
3. Open the new `.env` file and review its contents. Adjust any environment variables as needed for your development setup.
4. If you encounter errors during database migrations, update the database connection settings in your `.env` file. Use the IP address or hostname of your PostgreSQL database container. You can find this information by running `docker ps` after executing `spin up`.
2024-08-26 14:35:51 +02:00
2024-08-26 21:38:20 +02:00
5. Save the changes to your `.env` file.
2024-08-26 14:35:51 +02:00
2024-08-26 14:57:28 +02:00
2024-08-26 21:38:20 +02:00
## 5. Start Coolify
2024-08-26 14:35:51 +02:00
2024-08-26 22:08:21 +02:00
1. Open a terminal in the local Coolify directory.
2024-08-26 14:35:51 +02:00
2024-08-26 22:08:21 +02:00
2. Run the following command in the terminal (leave that terminal open):
2024-08-26 14:35:51 +02:00
```
spin up
```
Note: You may see some errors, but don't worry; this is expected.
2024-08-26 14:57:28 +02:00
3. If you encounter permission errors, especially on macOS, use:
2024-08-26 14:35:51 +02:00
```
sudo spin up
```
2024-08-26 22:08:21 +02:00
Note: If you change environment variables afterwards or anything seems broken, press Ctrl + C to stop the process and run `spin up` again.
2024-08-26 14:57:28 +02:00
2024-08-26 15:44:30 +02:00
## 6. Start Development
2024-08-26 14:35:51 +02:00
1. Access your Coolify instance:
- URL: `http://localhost:8000`
- Login: `test@example.com`
- Password: `password`
2. Additional development tools:
- Laravel Horizon (scheduler): `http://localhost:8000/horizon`
Note: Only accessible when logged in as root user
- Mailpit (email catcher): `http://localhost:8025`
2024-08-26 14:55:03 +02:00
- Telescope (debugging tool): `http://localhost:8000/telescope`
2024-08-26 21:38:20 +02:00
Note: Disabled by default (so the database is not overloaded), enable by adding the following environment variable to your `.env` file:
2024-08-26 14:55:03 +02:00
```env
TELESCOPE_ENABLED=true
```
2024-08-26 14:35:51 +02:00
2024-08-26 14:57:28 +02:00
2024-08-26 15:44:30 +02:00
## 7. Contributing a New Service
2024-08-26 14:35:51 +02:00
To add a new service to Coolify, please refer to our documentation:
2024-08-26 15:10:10 +02:00
[Adding a New Service](https://coolify.io/docs/knowledge-base/add-a-service)