Update Dockerfile
Browse files- Dockerfile +25 -13
Dockerfile
CHANGED
@@ -1,18 +1,30 @@
|
|
1 |
-
# Use Python image as
|
2 |
-
FROM python:3.
|
3 |
|
4 |
-
# Set
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
-
# Install
|
12 |
-
RUN pip install
|
|
|
|
|
13 |
|
14 |
-
# Expose
|
15 |
-
EXPOSE
|
16 |
|
17 |
-
#
|
18 |
-
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python image as base
|
2 |
+
FROM python:3.8-slim
|
3 |
|
4 |
+
# Set environment variables
|
5 |
+
ENV PYTHONUNBUFFERED=1 \
|
6 |
+
LANG=C.UTF-8 \
|
7 |
+
LC_ALL=C.UTF-8 \
|
8 |
+
DEBIAN_FRONTEND=noninteractive \
|
9 |
+
TZ=UTC
|
10 |
|
11 |
+
# Install necessary system dependencies
|
12 |
+
RUN apt-get update && \
|
13 |
+
apt-get install -y --no-install-recommends \
|
14 |
+
build-essential \
|
15 |
+
git \
|
16 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
+
# Install Jupyter Notebook and Jupyter Lab
|
19 |
+
RUN pip install --no-cache-dir \
|
20 |
+
notebook \
|
21 |
+
jupyterlab
|
22 |
|
23 |
+
# Expose port 8888 for Jupyter Notebook
|
24 |
+
EXPOSE 8888
|
25 |
|
26 |
+
# Create a directory for storing Jupyter Notebooks
|
27 |
+
WORKDIR /notebooks
|
28 |
+
|
29 |
+
# Start Jupyter Notebook when the container starts
|
30 |
+
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
|