Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish Docker image

on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: docker-publish-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Normalize image owner
id: owner
run: echo "value=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.owner.outputs.value }}/lollms-hub
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=sha-
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and publish Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,19 @@ The built-in Help page is now a rich document with a sticky table of contents th

If you prefer a container-based workflow, we've got you covered.

**1. Build the Docker image:**
**Option A. Pull the published GHCR image:**
```bash
docker pull ghcr.io/parisneo/lollms-hub:latest
```

If you're using a fork, replace `parisneo` with your GitHub owner name.

**Option B. Build the Docker image locally:**
```bash
docker build -t lollms-hub .
```

**2. Run the container:**
**Run the container:**
Create a `.env` file on your host machine, then run:
```bash
docker run -d --name lollms-hub \
Expand All @@ -221,8 +228,10 @@ docker run -d --name lollms-hub \
-v ./lollms_hub.db:/home/app/lollms_hub.db \
-v ./.ssl:/home/app/.ssl \
-v ./app/static/uploads:/home/app/app/static/uploads \
lollms-hub
ghcr.io/parisneo/lollms-hub:latest
```
If you built the image locally instead, replace the final image reference with `lollms-hub`.

*Note the extra volume mounts for the database, SSL files, and user uploads to persist data outside the container.*

---
Expand Down Expand Up @@ -260,4 +269,4 @@ Visit the project on [GitHub](https://github.com/ParisNeo/lollms_hub) to contrib

## License

This project is licensed under the Apache License 2.0. Feel free to use, modify, and distribute.
This project is licensed under the Apache License 2.0. Feel free to use, modify, and distribute.