mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-11 17:28:05 +02:00
feat: add docker deploy workflow and unraid config
This commit is contained in:
1 parent
7b9add75ad
commit
4b39e32ce7
3 files changed
+105
No files matched your search
@@ -0,0 +1,46 @@
|
||||
name: Docker Build and Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -14,6 +14,22 @@ make docker-up
|
||||
|
||||
Access the API: `http://localhost:8080`
|
||||
|
||||
## Deployment
|
||||
|
||||
### Unraid
|
||||
|
||||
A dedicated configuration file `docker-compose.unraid.yaml` is provided for Unraid servers. It pulls the pre-built image from GitHub Container Registry.
|
||||
|
||||
1. Copy **only** `docker-compose.unraid.yaml` to your Unraid server (e.g. into `/mnt/user/appdata/flowreader`).
|
||||
2. Run with Docker Compose:
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.unraid.yaml up -d
|
||||
```
|
||||
|
||||
Note: The configuration uses `/mnt/user/appdata/flowreader/postgres_data` for database persistence.
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
services:
|
||||
app:
|
||||
# Utilise l'image construite par GitHub Actions
|
||||
image: ghcr.io/r0m1k3/flowreader:latest
|
||||
container_name: flowreader-app
|
||||
# build:
|
||||
# context: .
|
||||
# dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- PORT=8080
|
||||
- DATABASE_URL=postgres://flowreader:flowreader@db:5432/flowreader?sslmode=disable
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
# Mappage des logs si nécessaire
|
||||
# volumes:
|
||||
# - /mnt/user/appdata/flowreader/logs:/app/logs
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: flowreader-db
|
||||
environment:
|
||||
- POSTGRES_USER=flowreader
|
||||
- POSTGRES_PASSWORD=flowreader
|
||||
- POSTGRES_DB=flowreader
|
||||
volumes:
|
||||
# Persistance des données sur Unraid (chemin typique)
|
||||
- /mnt/user/appdata/flowreader/postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U flowreader -d flowreader" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
command: >
|
||||
postgres -c shared_buffers=24MB -c max_connections=20 -c work_mem=2MB
|
||||
|
||||
# Pas de volumes nommés globaux si on utilise des bind mounts directs pour Unraid
|
||||
Reference in new issue
Block a user