forked from deephaven/deephaven-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (47 loc) · 2.25 KB
/
Dockerfile
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
# syntax=docker/dockerfile:1
# Dockerfile for starting up a deephaven-server with these latest plugins built and installed
# Expects to be run from the root of the deephaven-plugins repo
# First lets build and install the JS plugins
FROM node:18 AS base
WORKDIR /work/
# Update packages list and install python python
RUN set -eux; \
apt-get update; \
apt-get install python3-pip --yes;
# This is a workaround for copying all package.json files w/ directory structure
# without needing to list every file as a COPY command
# The copy --from=copy-plugins command will be a cache hit if the package.json files didn't change
FROM alpine AS copy-plugins
WORKDIR /work/
COPY plugins /tmp/deephaven-plugins
COPY package.json package-lock.json requirements.txt ./
# cd first so the cp doesn't include /tmp/deephaven-plugins in the paths
RUN cd /tmp/deephaven-plugins && cp --parents ./*/src/js/package.json /work/ && cp --parents ./*/setup.* /work/
FROM base as build
WORKDIR /work/
COPY --from=copy-plugins /work/ .
# Install the python requirements
RUN pip3 install -r requirements.txt --break-system-packages
# Install the npm packages
RUN npm ci
COPY babel.config.js lerna.json nx.json tsconfig.json ./
# Copy the deephaven-plugins source files to the docker image
# We do this last because the source files are the most likely to change
# This requires the Dockerfile to be built in the context of the root of the deephaven-plugins repository
# https://stackoverflow.com/a/34300129
COPY plugins plugins
# delete the plotly plugin as it's deprecated
RUN rm -rf plugins/plotly
# Build the JS
RUN npm run build
# Now build the Python bundles
RUN find ./plugins -maxdepth 1 -mindepth 1 -type d -exec python3 -m build --wheel {} \;
FROM ghcr.io/deephaven/server:edge
COPY --link --from=build /work/ /opt/deephaven/config/plugins/
RUN pip install /opt/deephaven/config/plugins/plugins/*/dist/*.whl
COPY --link docker/config/deephaven.prop /opt/deephaven/config/deephaven.prop
# We copy our data directory in from the data container in case we're publishing the image
# However, you can mount a volume to override this in the docker-compose.override.yml
COPY --link docker/data /data
# Set the environment variable to enable the JS plugins embedded in Python
ENV DEEPHAVEN_ENABLE_PY_JS=true