Skip to content

Commit 0547eaa

Browse files
committed
Install binary in container
Instead of copying the source code and executing the package, this patch only installs the binary in the container, discarding additional source files. This will not make much of a difference but should be slightly faster and result in slightly smaller containers. This also now uses the arguably nicer location of `/etc/camera-control.yml` for the default configuration file. This means that we will have the same configuration location for all installation types.
1 parent b24ce7a commit 0547eaa

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
FROM python:3.12-slim
2-
EXPOSE 8000
3-
1+
FROM python:3.12-slim as build
42
COPY . /occameracontrol
5-
WORKDIR /occameracontrol
63

7-
RUN pip install --no-cache-dir -r /occameracontrol/requirements.txt
4+
FROM python:3.12-slim
5+
EXPOSE 8000
6+
RUN --mount=type=bind,from=build,source=/occameracontrol,target=/occameracontrol \
7+
--mount=type=tmpfs,destination=/tmp \
8+
cp -r /occameracontrol /tmp \
9+
&& pip install --no-cache-dir /tmp/occameracontrol \
10+
&& cp /occameracontrol/camera-control.yml /etc/camera-control.yml
811

912
USER nobody
10-
ENTRYPOINT [ "python", "-m", "occameracontrol"]
13+
ENTRYPOINT [ "opencast-camera-control" ]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ services:
8080
ports:
8181
- '8000:8000'
8282
volumes:
83-
- './your_config.yml:/occameracontrol/config.yml'
83+
- './your_config.yml:/etc/camera-control.yml'
8484
```

0 commit comments

Comments
 (0)