-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.46 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
FROM quay.io/jupyter/minimal-notebook:2024-10-03
# Set environment variables to avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Make sure the contents of our repo are in ${HOME}
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
# Update package list and install required dependencies
RUN apt-get update && \
apt-get install -y software-properties-common libdb-dev libzmq3-dev curl libssl-dev zlib1g-dev jq jupyter-console pkg-config default-libmysqlclient-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install pipx and add its binary directory to PATH
RUN pip install pipx && \
pipx ensurepath
ENV PATH="/home/jovyan/.local/bin:$PATH"
# Use pipx to install Poetry
RUN pipx install poetry
# Copy pyproject.toml and poetry.lock if it exists
COPY pyproject.toml poetry.lock* ./
# Install project dependencies using Poetry
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi --with examples
# Install dependencies from requirements.in if it exists
# COPY requirements.in ./
# RUN if [ -f requirements.in ]; then pip install --upgrade -r requirements.in; fi
# Create necessary directories and set permissions
RUN mkdir -p /home/jovyan/.local/share/jupyter && \
chown -R jovyan:users /home/jovyan/.local
VOLUME ["/home/jovyan/work", "/data"]
# Switch back to jovyan to avoid accidental container runs as root
USER ${NB_UID}
# Verify permissions
RUN ls -la /home/jovyan/.local/share