mirror of
https://gitlab.gudd-it.de/bastian/ivatar-docker.git
synced 2025-11-15 12:38:01 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d410f89368 | |||
| 031b935584 | |||
| e9155b5169 | |||
| 3a79f9de5f | |||
| 9175898bf3 | |||
| d844f74834 | |||
| ee3e694f4d | |||
| 7497a96a6e |
19
.env.example
Normal file
19
.env.example
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Ivatar Configuration
|
||||||
|
# Copy this file to .env and customize the values
|
||||||
|
|
||||||
|
# Site Configuration
|
||||||
|
SITE_NAME=My Ivatar Instance
|
||||||
|
BASE_URL=http://localhost:8080/avatar/
|
||||||
|
SECURE_BASE_URL=https://your-domain.com/avatar/
|
||||||
|
|
||||||
|
# Database Configuration
|
||||||
|
POSTGRES_PASSWORD=ivatar_secure_password_change_me
|
||||||
|
|
||||||
|
# Email Configuration
|
||||||
|
EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
|
||||||
|
SERVER_EMAIL=ivatar@your-domain.com
|
||||||
|
DEFAULT_FROM_EMAIL=ivatar@your-domain.com
|
||||||
|
|
||||||
|
# Mailgun Configuration (optional)
|
||||||
|
# MAILGUN_API_KEY=your_mailgun_api_key
|
||||||
|
# MAILGUN_SENDER_DOMAIN=your-domain.com
|
||||||
52
.gitea/workflows/build-and-push.yml
Normal file
52
.gitea/workflows/build-and-push.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install system Dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y curl jq docker.io
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Log in to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.purpleraft.com
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: gitea.purpleraft.com/${{ gitea.repository }}
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
type=sha,prefix={{branch}}-
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -6,12 +6,13 @@ RUN apk add --no-cache --virtual build-deps build-base gcc python3-dev musl-dev
|
|||||||
apk add --no-cache py3-virtualenv openldap-dev libffi-dev mariadb-dev zlib-dev
|
apk add --no-cache py3-virtualenv openldap-dev libffi-dev mariadb-dev zlib-dev
|
||||||
# RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so
|
# RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so
|
||||||
|
|
||||||
RUN git clone https://git.linux-kernel.at/oliver/ivatar.git .
|
RUN git clone https://gitea.purpleraft.com/external-repos/ivatar.git .
|
||||||
|
|
||||||
RUN virtualenv -p python3 .virtualenv && \
|
RUN virtualenv -p python3 .virtualenv && \
|
||||||
source .virtualenv/bin/activate && \
|
source .virtualenv/bin/activate && \
|
||||||
|
pip install --upgrade pip setuptools wheel && \
|
||||||
pip install 2to3 pillow && \
|
pip install 2to3 pillow && \
|
||||||
pip install -r requirements.txt
|
pip install --no-build-isolation -r requirements.txt
|
||||||
|
|
||||||
RUN apk del build-deps && pip cache purge
|
RUN apk del build-deps && pip cache purge
|
||||||
|
|
||||||
|
|||||||
29
README.md
29
README.md
@@ -30,6 +30,35 @@ Please be aware that this will not persist any data.
|
|||||||
| `POSTGRESQL_PASSWORD` | | - |
|
| `POSTGRESQL_PASSWORD` | | - |
|
||||||
|
|
||||||
|
|
||||||
|
## Gitea Actions CI/CD
|
||||||
|
|
||||||
|
This repository includes a Gitea Actions workflow that automatically builds and pushes the Docker image to your Gitea container registry.
|
||||||
|
|
||||||
|
### Setup Instructions
|
||||||
|
|
||||||
|
1. **Create a Personal Access Token:**
|
||||||
|
- Go to your Gitea instance: https://gitea.purpleraft.com/
|
||||||
|
- Navigate to Settings → Applications → Generate New Token
|
||||||
|
- Create a token with `write:packages` permission
|
||||||
|
- Copy the token value
|
||||||
|
|
||||||
|
2. **Add Repository Secret:**
|
||||||
|
- Go to your repository settings
|
||||||
|
- Navigate to Secrets and Variables → Actions
|
||||||
|
- Add a new secret named `GITEA_TOKEN` with your personal access token as the value
|
||||||
|
|
||||||
|
3. **Enable Actions (if not already enabled):**
|
||||||
|
- Ensure Gitea Actions are enabled in your repository settings
|
||||||
|
- The workflow will trigger on pushes to main/master branches and pull requests
|
||||||
|
|
||||||
|
### Workflow Features
|
||||||
|
|
||||||
|
- Builds Docker image using Docker Buildx
|
||||||
|
- Pushes to `gitea.purpleraft.com/{username}/{repository}`
|
||||||
|
- Creates multiple tags: branch name, latest (for default branch), and commit SHA
|
||||||
|
- Uses GitHub Actions cache for faster builds
|
||||||
|
- Runs on pushes and pull requests
|
||||||
|
|
||||||
## To Do
|
## To Do
|
||||||
- Figure out where the pictures are stored
|
- Figure out where the pictures are stored
|
||||||
- Write some setup instructions
|
- Write some setup instructions
|
||||||
|
|||||||
51
compose.yml
Normal file
51
compose.yml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
services:
|
||||||
|
postgresql:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ivatar
|
||||||
|
POSTGRES_USER: ivatar
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ivatar_secure_password}
|
||||||
|
networks:
|
||||||
|
- ivatar-network
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
- CMD-SHELL
|
||||||
|
- pg_isready -U ivatar -d ivatar
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
ivatar:
|
||||||
|
image: gitea.purpleraft.com/ryan/ivatar-docker:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
postgresql:
|
||||||
|
condition: service_healthy
|
||||||
|
ports:
|
||||||
|
- '8080:8080'
|
||||||
|
volumes:
|
||||||
|
- ivatar_data:/ivatar/media
|
||||||
|
environment:
|
||||||
|
SITE_NAME: ${SITE_NAME:-My Ivatar Instance}
|
||||||
|
BASE_URL: ${BASE_URL:-http://localhost:8080/avatar/}
|
||||||
|
SECURE_BASE_URL: ${SECURE_BASE_URL:-https://your-domain.com/avatar/}
|
||||||
|
POSTGRESQL_DATABASE: ivatar
|
||||||
|
POSTGRESQL_USER: ivatar
|
||||||
|
POSTGRESQL_PASSWORD: ${POSTGRES_PASSWORD:-ivatar_secure_password}
|
||||||
|
EMAIL_BACKEND: ${EMAIL_BACKEND:-django.core.mail.backends.console.EmailBackend}
|
||||||
|
SERVER_EMAIL: ${SERVER_EMAIL:-ivatar@your-domain.com}
|
||||||
|
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL:-ivatar@your-domain.com}
|
||||||
|
networks:
|
||||||
|
- ivatar-network
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data: null
|
||||||
|
ivatar_data: null
|
||||||
|
|
||||||
|
networks:
|
||||||
|
ivatar-network:
|
||||||
|
driver: bridge
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
|
|
||||||
|
# Activate the virtual environment
|
||||||
|
source .virtualenv/bin/activate
|
||||||
|
|
||||||
|
# Run Django migrations
|
||||||
./manage.py migrate
|
./manage.py migrate
|
||||||
|
|
||||||
|
# Start the Django development server
|
||||||
exec ./manage.py runserver 0:8080
|
exec ./manage.py runserver 0:8080
|
||||||
|
|||||||
Reference in New Issue
Block a user