-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (23 loc) · 891 Bytes
/
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
# 1. Use a Python base image
FROM python:3.10
# 2. Set the working directory
WORKDIR /app
# 3. Install build tools for building the Python module
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# 4. Copy the pyproject.toml and other build files
COPY pyproject.toml ./
# 5. Install dependencies using pip or poetry
# Assuming pyproject.toml follows PEP 517/518 and works with pip:
RUN pip install --no-cache-dir build \
&& python -m build --wheel \
&& pip install --no-cache-dir dist/*.whl
# 6. Copy the entire project to the container
COPY . .
# 7. Install Jupyter Notebook
RUN pip install --no-cache-dir notebook
# 8. Expose Jupyter Notebook default port
EXPOSE 8888
# 9. Set the default command to start Jupyter Notebook
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--no-browser", "--allow-root"]