-
Notifications
You must be signed in to change notification settings - Fork 208
Expand file tree
/
Copy pathtest.Dockerfile
More file actions
81 lines (62 loc) · 2.73 KB
/
test.Dockerfile
File metadata and controls
81 lines (62 loc) · 2.73 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
FROM python:3.10.14
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:11-jdk $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
build-essential curl git util-linux jq sudo fonts-noto-cjk
# Install Node.js 20.x from NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs
ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
JUPYTER_CONFIG_PATH="/root/.jupyter" \
IPYTHON_CONFIG_PATH="/root/.ipython" \
SERVER_PATH="/root/.server" \
RUBY_VERSION=3.4.3
ENV RUBY_HOME=/opt/ruby/${RUBY_VERSION}
# Install Jupyter
COPY ./template/requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt && ipython kernel install --name "python3" --user
# Javascript Kernel
RUN npm install -g --unsafe-perm ijavascript
RUN ijsinstall --install=global
## TypeScript compiler
RUN npm install -g @swc/cli @swc/core
COPY ./template/.ts.swcrc $SERVER_PATH/.ts.swcrc
# Deno Kernel
COPY --from=denoland/deno:bin-2.0.4 /deno /usr/bin/deno
RUN chmod +x /usr/bin/deno
RUN deno jupyter --unstable --install
COPY ./template/deno.json /root/.local/share/jupyter/kernels/deno/kernel.json
# Install Ruby using ruby-build
RUN git clone https://github.com/rbenv/ruby-build.git ~/.ruby-build
RUN ~/.ruby-build/bin/ruby-build ${RUBY_VERSION} ${RUBY_HOME}
ENV PATH="${RUBY_HOME}/bin:${PATH}"
ENV PATH="/root/.local/share/gem/ruby/${RUBY_VERSION%.*}.0/bin:${PATH}"
# Install IRuby
RUN gem install --user-install rubygems-requirements-system && \
gem install --user-install iruby && \
iruby register --force
# Create separate virtual environment for server
RUN python -m venv $SERVER_PATH/.venv
# Copy server and its requirements
RUN mkdir -p $SERVER_PATH/
COPY ./template/server/requirements.txt $SERVER_PATH
RUN $SERVER_PATH/.venv/bin/pip install --no-cache-dir -r $SERVER_PATH/requirements.txt
COPY ./template/server $SERVER_PATH
# Copy matplotlibrc
COPY ./template/matplotlibrc /root/.config/matplotlib/matplotlibrc
# Copy Jupyter configuration
COPY ./template/start-up.sh $JUPYTER_CONFIG_PATH/
RUN chmod +x $JUPYTER_CONFIG_PATH/start-up.sh
COPY ./template/jupyter_server_config.py $JUPYTER_CONFIG_PATH/
RUN mkdir -p $IPYTHON_CONFIG_PATH/profile_default
COPY ./template/ipython_kernel_config.py $IPYTHON_CONFIG_PATH/profile_default/
RUN mkdir -p $IPYTHON_CONFIG_PATH/profile_default/startup
COPY ./template/startup_scripts/* $IPYTHON_CONFIG_PATH/profile_default/startup
# Setup entrypoint for local development
WORKDIR /home/user
COPY ./chart_data_extractor ./chart_data_extractor
RUN pip install -e ./chart_data_extractor
ENTRYPOINT $JUPYTER_CONFIG_PATH/start-up.sh