1
+ # syntax=docker/dockerfile:1.3
2
+ FROM registry.access.redhat.com/ubi8/nodejs-14-minimal AS frontend-builder
3
+
4
+ ENV NPM_CACHE_LOCATION=$HOME/.npm \
5
+ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
6
+
7
+ WORKDIR /label-studio/label_studio/frontend
8
+
9
+ COPY --chown=1001:0 label_studio/frontend .
10
+ COPY --chown=1001:0 label_studio/__init__.py /label-studio/label_studio/__init__.py
11
+
12
+ RUN --mount=type=cache,target=$NPM_CACHE_LOCATION,uid=1001,gid=0 \
13
+ npm ci \
14
+ && npm run build:production
15
+
16
+ FROM registry.access.redhat.com/ubi8/python-39
17
+
18
+ ENV LS_DIR=/label-studio \
19
+ PIP_CACHE_DIR=$HOME/.cache \
20
+ DJANGO_SETTINGS_MODULE=core.settings.label_studio \
21
+ LABEL_STUDIO_BASE_DATA_DIR=/label-studio/data
22
+
23
+ WORKDIR $LS_DIR
24
+
25
+ # Copy and install middleware dependencies
26
+ COPY --chown=1001:0 deploy/requirements-mw.txt .
27
+ RUN --mount=type=cache,target=$PIP_CACHE_DIR,uid=1001,gid=0 \
28
+ pip3 install -r requirements-mw.txt
29
+
30
+ # Copy and install requirements.txt first for caching
31
+ COPY --chown=1001:0 deploy/requirements.txt .
32
+ RUN --mount=type=cache,target=$PIP_CACHE_DIR,uid=1001,gid=0 \
33
+ pip3 install -r requirements.txt
34
+
35
+ COPY --chown=1001:0 . .
36
+ RUN --mount=type=cache,target=$PIP_CACHE_DIR,uid=1001,gid=0 \
37
+ pip3 install -e .
38
+
39
+ RUN rm -rf ./label_studio/frontend
40
+ COPY --chown=1001:0 --from=frontend-builder /label-studio/label_studio/frontend/dist ./label_studio/frontend/dist
41
+
42
+ RUN python3 label_studio/manage.py collectstatic --no-input
43
+
44
+ EXPOSE 8080
45
+
46
+ LABEL name="LabelStudio" \
47
+
48
+ vendor="Heartex" \
49
+ version="1.5.0dev" \
50
+ release="1" \
51
+ summary="LabelStudio" \
52
+ description="Label Studio is an open source data labeling tool."
53
+
54
+ COPY --chown=1001:0 licenses/ /licenses
55
+ RUN cp $LS_DIR/LICENSE /licenses
56
+
57
+ ENTRYPOINT ["./deploy/docker-entrypoint.sh"]
58
+ CMD ["label-studio"]
0 commit comments