3.1 KiB
3.1 KiB
Deployment to Gitea Package Registry
This document describes how to deploy the Docker images to the Gitea package registry using the Python deployment script.
Prerequisites
- Python 3.x installed on your system
- Access to Gitea server at https://brokkr.robotico.dev/
- A personal access token with package write permissions
- Docker and Docker Compose installed
Setup
1. Install Python Dependencies
pip install -r requirements.txt
This installs:
python-dotenv- For loading environment variables from .env file
2. Create .env file
Create a .env file in the project root (this file is git-ignored):
PUBLISH_TOKEN=your_gitea_personal_access_token_here
Important: Never commit the .env file to version control!
3. Get Your Gitea Token
- Log in to https://brokkr.robotico.dev/
- Go to User Settings → Applications
- Create a new token with "write:package" permission
- Copy the token and add it to your
.envfile
Deployment
Run the Python deployment script:
python deploy.py
Or on systems where Python 3 is not the default:
python3 deploy.py
The script will:
- Load the
PUBLISH_TOKENfrom.envfile - Build both frontend and backend Docker images using docker-compose
- Tag them for the Gitea registry
- Log in to the Gitea Docker registry
- Push both images to the registry
What the Script Does
The Python deployment script (deploy.py) performs the following steps:
- Loads the
PUBLISH_TOKENfrom.envfile using python-dotenv - Validates that the token exists
- Builds both frontend and backend Docker images via
docker-compose build - Tags them for the Gitea registry:
https://brokkr.robotico.dev/dalex/dalex-todo-backend:latesthttps://brokkr.robotico.dev/dalex/dalex-todo-frontend:latest
- Logs in to the Gitea Docker registry
- Pushes both images to the registry
- Displays success message with package URLs
Using the Deployed Images
After deployment, you can pull and use the images from the Gitea registry:
docker pull https://brokkr.robotico.dev/dalex/dalex-todo-backend:latest
docker pull https://brokkr.robotico.dev/dalex/dalex-todo-frontend:latest
Or update your docker-compose.yml to use the registry images instead of building locally:
services:
backend:
image: https://brokkr.robotico.dev/dalex/dalex-todo-backend:latest
# Remove the 'build' section
frontend:
image: https://brokkr.robotico.dev/dalex/dalex-todo-frontend:latest
# Remove the 'build' section
Troubleshooting
Authentication Failed
- Verify your token is correct in the
.envfile - Check that the token has "write:package" permission
- Ensure the token hasn't expired
Build Failed
- Run
docker-compose buildmanually to see detailed error messages - Check that all source files are present and correct
Push Failed
- Verify you have write access to the
dalexorganization/user on Gitea - Check network connectivity to https://brokkr.robotico.dev/
- Ensure the registry URL is correct
Package Registry Location
The packages will be available at: https://brokkr.robotico.dev/dalex/-/packages