generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.notebook
executable file
·49 lines (35 loc) · 1.27 KB
/
Dockerfile.notebook
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
FROM jupyter/minimal-notebook
USER root
# Install system dependencies for Docker
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Add Docker's official GPG key
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Set up the stable repository
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Install Docker CLI
RUN apt-get update && apt-get install -y docker-ce-cli
WORKDIR /app
COPY src /app/src
COPY requirements_notebook.txt .
COPY requirements.txt .
#RUN pip install --no-cache-dir -r requirements.txt
RUN pip install 'teehr @ git+https://github.com/RTIInternational/[email protected]'
RUN pip install --no-cache-dir -r requirements_notebook.txt
# Install the Docker SDK for Python
RUN pip install --no-cache-dir docker
# Add jovyan user to the Docker group to allow Docker command execution
RUN groupadd docker && usermod -aG docker jovyan
# Ensure the jovyan user owns the /app directory
RUN chown -R jovyan:users /app
# Switch back to jovyan to avoid running as root
USER jovyan
# Set the working directory (this is redundant if already set, but included for clarity)
WORKDIR /app