forked from jataware/beaker-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (36 loc) · 1.31 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
FROM python:3.10
RUN useradd -m jupyter
EXPOSE 8888
# Install system libraries required for geospatial packages
RUN apt-get update && apt-get install -y \
libgdal-dev \
libgeos-dev \
libproj-dev \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables used by the geospatial libraries
ENV GDAL_VERSION=3.0.2
ENV GEOS_VERSION=3.8.3
COPY requirements.txt ./
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN git clone https://github.com/DARPA-CRITICALMAAS/beak-ta3.git /jupyter/beak-ta3
WORKDIR /jupyter/beak-ta3
RUN pip install -r requirements.txt
RUN pip install -v .
WORKDIR /jupyter
RUN rm -r /jupyter/beak-ta3
# Install Python requirements
RUN pip install --upgrade --no-cache-dir hatch pip
# Install project requirements
COPY --chown=1000:1000 pyproject.toml README.md hatch_build.py /jupyter/
# Hack to install requirements without requiring the rest of the files
RUN pip install --no-cache-dir -e /jupyter
# Copy src code over
COPY --chown=1000:1000 . /jupyter
RUN chown -R 1000:1000 /jupyter
RUN pip install --no-cache-dir /jupyter
# Switch to non-root user. It is crucial for security reasons to not run jupyter as root user!
USER jupyter
WORKDIR /jupyter
# Service
CMD ["python", "-m", "beaker_kernel.server.main", "--ip", "0.0.0.0"]