.env.example | ||
.gitignore | ||
.s3cfg.example | ||
backup.sh | ||
backup.sh.save | ||
docker-compose.yaml | ||
Dockerfile | ||
README.md |
Gitea Self-Host Docker-Compose
This repository provides a complete setup for self-hosting Gitea using Docker Compose. It also includes a custom backup solution using s3cmd
to securely store your backups in S3-compatible object storage with GPG encryption.
Prerequisites
Before you begin, ensure you have the following installed:
- Docker
- Docker Compose
Getting Started
1. Clone the Repository
2. Set Up Docker Compose
Ensure the docker-compose.yml
is configured correctly with your preferred settings for Gitea and any additional services like PostgreSQL or MySQL.
3. Start the Gitea Service
docker-compose up -d
This will start Gitea along with the configured services.
4. Custom Backup Solution
We provide a custom backup solution that uses s3cmd
to upload your Gitea backups to an S3-compatible storage service with GPG encryption. Both s3cmd
and GPG are included in the backup Docker container, so you do not need to install them locally.
4.1 Configure s3cmd
in Docker
You need to configure s3cmd
within the backup Docker container. This will generate the necessary configuration file that the backup script will use.
-
Run the Docker container with the volume mounted to store the configuration:
docker run --rm -it -v ./s3cfg:/root/ d3fk/s3cmd --configure
-
Follow the prompts to input your access key, secret key, gpg application path
/usr/bin/gpg
, gpg passphrase and other settings. The configuration file will be saved to thes3cfg
directory in your project. -
Extract the .s3cfg inside the s3cfg folder and change the permissions of the file to the proper user
4.2 Schedule Backups with Cron
You change change the backup schedule inside the Dockerfile directly. Don't forget to build the container for the change to take effect.
docker compose up -d --build
Additional Resources
License
This project is licensed under the MIT License.