FROM node:16.20.2
COPY . /app
WORKDIR /app
RUN npm -v
RUN npm install
EXPOSE 8080
docker build -t study:0.0.2 -f Dockfile.text .
this command package the project as a image;
2.docker is server; you must start you can use docker;
open appication in windows
docker save -o ko.jar study:0.0.2
will package image to a jar
4.
scp your_image_name.tar root@129.211.184.254:/path/to/destination
link your server and push file to server
5.In server
you must install docker
you can use yum install
docker sudo apt-get install docker-ce depends on you systemOs;
6.
sudo systemctl enable docker
it will automatically start docker after turn on the computer
7.
docker load -i /path/to/your_image_name.tar
load image from local environment;
docker image ls;
docker run -it -p 8080:8080 --name test -d -v /dd:/app study
-d is run the program in the background;
--name make a alias
-v map machine volume inside docker
Top comments (0)