Skip to content

Commit 53896fd

Browse files
tibroclkiesow
authored andcommitted
Add dockerfile and build infra
This commit adds a dockerfile and github actions to automatically build and publish the docker image. It also configures dependabot to check for updated base images.
1 parent bccd79d commit 53896fd

4 files changed

Lines changed: 69 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: docker
4+
directory: /
5+
schedule:
6+
interval: monthly
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
push_to_registries:
8+
name: Push Docker image to multiple registries
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
contents: read
13+
steps:
14+
- name: Check out the repo
15+
uses: actions/checkout@v4
16+
17+
- name: Log in to the Container registry
18+
uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Extract metadata (tags, labels) for Docker
25+
id: meta
26+
uses: docker/metadata-action@v5
27+
with:
28+
images: ghcr.io/${{ github.repository }}
29+
30+
- name: Build and push Docker images
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
push: true
35+
tags: ${{ steps.meta.outputs.tags }}
36+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:3.12-slim
2+
EXPOSE 8000
3+
4+
COPY . /occameracontrol
5+
WORKDIR /occameracontrol
6+
7+
RUN pip install --no-cache-dir -r /occameracontrol/requirements.txt
8+
9+
USER nobody
10+
ENTRYPOINT [ "python", "-m", "occameracontrol"]

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,20 @@ agent_calendar_update_time{agent="test_agent"} 1.707571943100096e+09
6161
# TYPE camera_position gauge
6262
camera_position{camera="http://camera-2-panasonic.example.com"} 10.0
6363
```
64+
65+
## Docker
66+
67+
We also provide a container image.
68+
A simple docker compose example would look like this
69+
70+
```yaml
71+
---
72+
version: '3'
73+
services:
74+
app:
75+
image: ghcr.io/virtuos/opencast-camera-control:main
76+
ports:
77+
- '8000:8000'
78+
volumes:
79+
- './your_config.yml:/occameracontrol/config.yml'
80+
```

0 commit comments

Comments
 (0)