Skip to content

Commit 29bf54d

Browse files
committed
Multi stage build
1 parent 2a66062 commit 29bf54d

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

pycaret_example/Dockerfile

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
FROM python:3.8-buster
1+
FROM python:3.8-buster as builder
22

33
RUN pip install --upgrade pip setuptools \
4-
&& pip install matplotlib jupyter pandas pycaret
4+
&& pip install matplotlib pandas pycaret
55

6-
CMD ["jupyter", "notebook", "--allow-root"]
6+
FROM python:3.8-slim-buster as runner
7+
8+
COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
9+
10+
RUN pip install --upgrade pip setuptools \
11+
&& pip install jupyterlab
12+
13+
ENTRYPOINT [ "jupyter-lab" ]
14+
CMD [ "--no-browser", "--allow-root", "--ip=0.0.0.0", "--port=8886", "--notebook-dir=/opt", "--NotebookApp.token=''" ]

pycaret_example/docker-compose.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.3'
22
services:
33
pycaret:
44
container_name: pycaret_example
5-
image: pycaret_example:0.1.0
5+
image: pycaret_example:0.2.0
66
build: .
77
tty: true
88
stdin_open: true
@@ -11,6 +11,4 @@ services:
1111
- "8886:8886"
1212
volumes:
1313
- ./notebook:/opt/notebook
14-
environment:
15-
- JUPYTER_CONFIG_DIR=/opt/notebook
1614
working_dir: /opt/notebook

pycaret_example/notebook/jupyter_notebook_config.py

-5
This file was deleted.

0 commit comments

Comments
 (0)