-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
112 lines (90 loc) · 4.05 KB
/
Dockerfile
File metadata and controls
112 lines (90 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright 2025 Optonic GmbH
# Author: Martin Rotzinger
#
# This work is based on the project at:
# https://github.com/wandelbotsgmbh/zivid-nova
#
# The original project or parts thereof may be copyrighted by Wandelbots GmbH.
#
# This work is subject to German copyright law.
# Copyright and related rights are held by Optonic GmbH.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Declare build argument with default version
ARG ENSENSO_SDK_VERSION=4.2.1765
ARG UEYE_VERSION=4.96.1
FROM python:3.11 AS base
# Re-declare the args in this stage to use them here
ARG ENSENSO_SDK_VERSION
ARG UEYE_VERSION
# Injected at build time
ARG APP_VERSION
ARG GIT_COMMIT
ARG GIT_BRANCH
ARG GIT_TAG
# install Ensenso SDK and all required dependencies like uEye camera driver
# uEye is only needed for cameras N30/N35/N40/N45
WORKDIR /tmp/ensenso
RUN apt-get update && \
wget --progress=dot:giga -O ids-software-suite-linux-64-${UEYE_VERSION}-debian.tgz \
"https://download.ensenso.com/s/idsdrivers/download?files=ids-software-suite-linux-64-${UEYE_VERSION}-debian.tgz" && \
wget --progress=dot:giga -O ensenso-sdk-${ENSENSO_SDK_VERSION}-x64.deb \
"https://download.ensenso.com/s/ensensosdk/download?files=ensenso-sdk-${ENSENSO_SDK_VERSION}-x64.deb" && \
wget --progress=dot:giga -O Ensenso-B57_Food-2.enscam \
"https://share.optonic.com/s/sampledata/download?path=%2F&files=Edeka-2.enscam" && \
wget --progress=dot:giga -O Ensenso-B57_Mini-Bits.enscam \
"https://share.optonic.com/s/sampledata/download?path=%2F&files=B-Mini-Bits.enscam" && \
tar -xzf ids-software-suite-linux-64-${UEYE_VERSION}-debian.tgz && \
ln -s /bin/true /usr/bin/systemctl && \
apt-get install -y --no-install-recommends ./*.deb && \
apt-get install -y libgtk-3-0 && \
apt-get clean && \
mkdir -p /opt/ensenso/examples/filecams && \
mv "Ensenso-B57_Food-2.enscam" "/opt/ensenso/examples/filecams/" && \
mv "Ensenso-B57_Mini-Bits.enscam" "/opt/ensenso/examples/filecams/" && \
rm -rf /tmp/ensenso && \
rm -rf /var/lib/apt/lists/*
WORKDIR /
COPY config/file_cameras.json /opt/ensenso/settings/NxLib/file_cameras.json
# install demo filecam for robot calibration
COPY assets/calibration_filecam/last_calibration_report__2025_05_30_08_37_39.zip /opt/ensenso/examples/filecams/
COPY assets/calibration_filecam/calibration_points.csv /opt/ensenso/examples/filecams/
COPY assets/calibration_filecam/calibration_points_result.csv /opt/ensenso/examples/filecams/
COPY assets/handyeye_calibration_filecam/ /opt/ensenso/examples/filecams/handyeye_calibration_filecam/
RUN pip install --upgrade pip \
&& pip install poetry==2.1.3
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
ENV ENSENSO_INSTALL=/opt/ensenso
# Set environment variables baked into image
ENV APP_VERSION=${APP_VERSION}
ENV GIT_COMMIT=${GIT_COMMIT}
ENV GIT_BRANCH=${GIT_BRANCH}
ENV GIT_TAG=${GIT_TAG}
# loading additional potentially dangerous debugging functions, switch env value in app_description if needed
ENV ENABLE_DEBUG_ENDPOINTS="false"
FROM base AS runtime
ENV VIRTUAL_ENV=/ensenso-nova/.venv PATH="/ensenso-nova/.venv/bin:$PATH"
WORKDIR /ensenso-nova
# install dependencies
COPY pyproject.toml poetry.lock ./
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
COPY static/ static/
COPY ensenso_nova/ ./ensenso_nova/
# install root package
RUN poetry install --without dev
# 🧠 Generate OpenAPI schema BEFORE running the server
RUN poetry run generate-schema
ENTRYPOINT ["poetry", "run", "serve"]