Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose files seems to be missing #105

Open
thisiseshan opened this issue Oct 5, 2022 · 1 comment
Open

Docker compose files seems to be missing #105

thisiseshan opened this issue Oct 5, 2022 · 1 comment

Comments

@thisiseshan
Copy link

I am unable to find the yaml file to follow along with the book. Kindly let us know if it is intended and will be added at a later date or if I am missing something.

@muneale
Copy link

muneale commented Nov 14, 2022

If you still need it, I develop my own docker-compose.yml file:

version: '3.8'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile.gpu
    container_name: app
    restart: unless-stopped
    volumes:
      - ./notebooks/:/home/gdl/notebooks
    ports:
      - "8888:8888"
      - "6006:6006"
    entrypoint: jupyter notebook --ip 0.0.0.0 --port=8888 /home/gdl/notebooks

In order to make this work you must:

  • create a directory called notebooks on the same level where the Dockerfiles lie
  • move all .ipynb files inside the directory notebooks
  • move the folders data, models, run, scripts and utils inside the directory notebooks
  • change the permissions of the files with the following command sudo chmod -R ugo+rw notebooks/

In this case I'm using the GPU Dockerfile version, just replace with the CPU version if you don't need it.

Lastly, I modified the Dockerfile.gpu as follow since I met some key issues with the Nvidia repository and the git package was missing:

FROM tensorflow/tensorflow:latest-gpu-py3-jupyter

## modify below
ARG username=gdl
ARG groupid=1000
ARG userid=1000
## end modify

RUN apt-key del 7fa2af80 && \
    apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub

RUN apt-get update && apt-get install -y \
    graphviz \
    libgraphviz-dev \
    git

COPY ./requirements.txt /
RUN python3 -m pip install --upgrade pip
RUN pip install -r /requirements.txt

# -m option creates a fake writable home folder for Jupyter.
RUN groupadd -g $groupid $username \
    && useradd -m -r -u $userid -g $username $username
USER $username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants