Skip to content

Commit

Permalink
Install binary in container
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lkiesow committed Feb 28, 2024
1 parent b24ce7a commit 0547eaa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM python:3.12-slim
EXPOSE 8000

FROM python:3.12-slim as build
COPY . /occameracontrol
WORKDIR /occameracontrol

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

USER nobody
ENTRYPOINT [ "python", "-m", "occameracontrol"]
ENTRYPOINT [ "opencast-camera-control" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ services:
ports:
- '8000:8000'
volumes:
- './your_config.yml:/occameracontrol/config.yml'
- './your_config.yml:/etc/camera-control.yml'
```

0 comments on commit 0547eaa

Please sign in to comment.