SoFunction
Updated on 2025-03-10

Docker+Jupyter Solution to deploy computing power services

Docker+Jupyter Deployment of computing power services

Use scenarios

When we learn to use various AI learning frameworks, we usually use Conda. If we want to publish the research framework to the server for use, we need some deployment solutions. Here our solution is the Docker+Jupyter method.

The environment required

Here I am using Windows environment. Linux students please study it yourself

Docker

Download and install Docker Desktop Docker Desktop in Windows

Jupyter mirror

It should be noted here that pull different Jupyter images according to the python version required by your AI framework

Provides the address sharing of pulling the docker image (requires a ladder)
/r/jupyter/base-notebook/tags

use

compose run

Recommended borrow files for creating docker containers. In which folder to place the file, this folder will serve as a group effect to place the containers in all files in a group for easy management.

  server:
    container_name: server
    image: hc_server:1.0
    user: root
    ports:
      - "3005:3005"
      - "8887:8888"
    volumes:
      - "D:\\docker\\commondir:/home/root/commondir"
    environment:
      - JUPYTER_TOKEN=123
      - NB_UID=0
      - NB_GID=0
      - NB_USER=root
      - NOTEBOOK_ARGS=--allow-root
    working_dir: /home/root
    command: ["sh", ""]
    restart: always

The above is the information about a container
container_name: container name
image: Mirror name and version
user: The user who uses root here should be careful, because the default user does not have sudo permissions, so it is recommended that we use root later if we do not want to encounter trouble.
ports: Port mapping inside and outside the container, if the IP is not written, it will be 0.0.0.0 if the IP is not written.
volumes: disk map path
environment: environment variable, JUPYTER_TOKEN here is a must for jupyter use. If you do not specify that you need to view the output log when the container is running, it is recommended to specify what you want and you don’t need to read the log again.
working_dir: Specify the working directory path in the container
command: a script that runs when the container is running

Start of service

After the service is run in the Jupyter environment, the easiest way is to directly specify the run command in the above command. Sometimes there are more running commands, so another way is to create a file in the working directory, so that only the command is required.command: ["sh", ""]Just write it.

This is the article about Docker+Jupyter deploying computing power services. For more related content on Dokcer Jupyter computing power services, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!