Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Dec 1, 2024
1 parent e2418cc commit 22d4ab8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,41 @@ on:
push:
pull_request:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- uses: mlugg/setup-zig@v1

- run: zig build test --summary all
- run: zig build

- name: Log in to the Container registry
if: github.event_name != 'pull_request'
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 }}

- 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 }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:24.04

RUN useradd -m -s /bin/bash -u 1000 acoustid

ADD zig-out/bin/fpindex /usr/bin

RUN mkdir -p /var/lib/acoustid/fpindex && chown -R acoustid /var/lib/acoustid/fpindex
VOLUME ["/var/lib/acoustid/fpindex"]

USER acoustid
EXPOSE 6080

CMD ["fpindex", "--dir", "/var/lib/acoustid/fpindex", "--address", "0.0.0.0", "--port", "6080"]

0 comments on commit 22d4ab8

Please sign in to comment.