Skip to content

Commit 22d4ab8

Browse files
committed
Add Dockerfile
1 parent e2418cc commit 22d4ab8

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/build.yml

+29
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,41 @@ on:
44
push:
55
pull_request:
66

7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
711
jobs:
812
build:
913
runs-on: ubuntu-24.04
1014
permissions:
1115
contents: read
1216
steps:
1317
- uses: actions/checkout@v4
18+
1419
- uses: mlugg/setup-zig@v1
20+
1521
- run: zig build test --summary all
22+
- run: zig build
23+
24+
- name: Log in to the Container registry
25+
if: github.event_name != 'pull_request'
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract metadata (tags, labels) for Docker
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
38+
- name: Build and push Docker image
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
push: ${{ github.event_name != 'pull_request' }}
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:24.04
2+
3+
RUN useradd -m -s /bin/bash -u 1000 acoustid
4+
5+
ADD zig-out/bin/fpindex /usr/bin
6+
7+
RUN mkdir -p /var/lib/acoustid/fpindex && chown -R acoustid /var/lib/acoustid/fpindex
8+
VOLUME ["/var/lib/acoustid/fpindex"]
9+
10+
USER acoustid
11+
EXPOSE 6080
12+
13+
CMD ["fpindex", "--dir", "/var/lib/acoustid/fpindex", "--address", "0.0.0.0", "--port", "6080"]

0 commit comments

Comments
 (0)