Skip to content

Commit

Permalink
Add automatic Docker image build (#43)
Browse files Browse the repository at this point in the history
* Add automatic Docker image build

Remove automatic build on every commit, add support for arm architectures, add image expiration

Fix variable

Co-authored-by: Ftonans <private>

* Remove expiration for docker release images

Release images should not be expirable

* Change image build to run on tag push

docker/metadata-action requires a push tag event for
semvar tag to work correctly

* Add ability to manually trigger docker image build

* Update README.md to mention docker images

* Create dev compose that builds off master

* Update docker-compose.yml to use Quay image

---------

Co-authored-by: syeopite <[email protected]>
  • Loading branch information
vlnst and syeopite authored Jul 3, 2024
1 parent 8361489 commit ac5ebe4
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 3 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create and publish a Docker image

env:
platforms: linux/amd64,linux/arm64,linux/armv8

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: {{ env.platforms }}

- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: quay.io/syeopite/priviblur
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: docker
platforms: {{ env.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ Priviblur has no official instance

## Installation

### Docker

You can install Priviblur through the official docker images here: https://quay.io/repository/syeopite/priviblur

A compose file to use this image is provided in the repository.

Configuration is then done by creating/editing a `config.toml` based off the example config. See configuration section below.

> [!TIP]
> Priviblur **officially** only provide images of each stable release. For an image built off of master you can use the image provided by PussTheCat.org here: https://github.com/PussTheCat-org/docker-priviblur-quay
### Manual

```bash

git clone "https://github.com/syeopite/priviblur"
Expand Down
29 changes: 29 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
priviblur:
build:
context: .
dockerfile: docker/Dockerfile
restart: unless-stopped
ports:
- "127.0.0.1:8000:8000" # Replace with "8000:8000" if you don't use a reverse proxy
volumes:
- ./config.toml:/priviblur/config.toml:Z,ro

# Redis is technically optional but is used for caching (remember to edit the config.toml file to actually make use of caching)
# Partially taken from https://github.com/zedeus/nitter/blob/b62d73dbd373f08af07c7a79efcd790d3bc1a49c/docker-compose.yml#L27-L44
priviblur-redis:
image: redis:6.2-alpine
container_name: priviblur-redis
command: redis-server --loglevel warning
volumes:
- priviblur-redis:/data
restart: unless-stopped
user: "999:1000"
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL

volumes:
priviblur-redis:
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
services:
priviblur:
build:
context: .
dockerfile: docker/Dockerfile
image: quay.io/syeopite/priviblur:latest
container_name: priviblur
restart: unless-stopped
ports:
- "127.0.0.1:8000:8000" # Replace with "8000:8000" if you don't use a reverse proxy
Expand Down

0 comments on commit ac5ebe4

Please sign in to comment.