2.7 KiB
2.7 KiB
Gitea Incus Deployment Script
This script automates the deployment of Gitea using a single Incus container with Docker Compose. It provides a simple command-line interface to create a profile and install Gitea with PostgreSQL.
Table of Contents
Prerequisites
- Incus installed and configured on your system
- Sudo or root access
Usage
Make the script executable:
chmod +x gitea.sh
Create Profile
Create an Incus profile for Gitea:
./gitea.sh profile [-c cpu] [-r ram]
Options:
-c cpu
: Specify the number of CPUs (optional)-r ram
: Specify the amount of RAM in GB (optional)
If CPU or RAM is not specified, the default Incus values will be used.
Install Gitea
Install Gitea and PostgreSQL using Docker Compose:
./gitea.sh install [-p dbpassword]
Options:
-p dbpassword
: Specify a custom database password (optional)
If no password is provided, a default password will be used.
Script Behavior
- The script enforces the correct order of operations:
- Profile must be created before installation
- The script will create a network named "incusbr0" if it doesn't exist
- The root disk size for the Incus container is set to 20GB by default
- Gitea will be accessible on port 3000, and SSH access will be on port 2222
- The script creates a single Incus container with nesting enabled
- Docker and Docker Compose are installed inside the Incus container
- Gitea and PostgreSQL are deployed using Docker Compose within the Incus container
Notes
- After installation, access Gitea through the web interface to complete the setup
- The script provides the URL to access Gitea after installation
- The latest versions of Gitea and PostgreSQL Docker images are used
Customization
You can modify the following variables at the top of the script to customize your deployment:
CONTAINER_NAME
: Name of the Incus containerWEB_PORT
: Port for accessing Gitea web interfaceSSH_PORT
: Port for SSH accessPROFILE_NAME
: Name of the Incus profileROOT_DISK_SIZE
: Size of the root disk for the containerNETWORK_NAME
: Name of the Incus networkDB_USER
: PostgreSQL database user for GiteaDB_PASS
: Default PostgreSQL database password (can be overridden during installation)
Troubleshooting
If you encounter any issues:
- Check the Incus container status:
incus list
- View the container logs:
incus exec gitea -- docker-compose logs
- Ensure all required ports are open and not in use by other services