-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatic Docker image build (#43)
* 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
Showing
4 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters