liuyuqi-dellpc 4 years ago
commit
0f576b9b1b
5 changed files with 46 additions and 0 deletions
  1. 13 0
      .dockerignore
  2. 2 0
      .gitignore
  3. 16 0
      Dockerfile
  4. 5 0
      client/package.json
  5. 10 0
      docker-compose.yml

+ 13 - 0
.dockerignore

@@ -0,0 +1,13 @@
+node_modules
+npm-debug.log
+Dockerfile*
+docker-compose*
+.dockerignore
+.git
+.gitignore
+.env
+*/bin
+*/obj
+README.md
+LICENSE
+.vscode

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+node_modules
+/docker-compose.debug.yml

+ 16 - 0
Dockerfile

@@ -0,0 +1,16 @@
+FROM daocloud.io/library/ubuntu:18.10
+LABEL Name=qhedu/nodejs Version=1.0.1
+
+RUN mkdir -p /root/app
+# ADD . /root/app
+WORKDIR /root/app
+
+RUN sed -i "s|http://archive.ubuntu.com|http://mirrors.aliyun.com|g" /etc/apt/sources.list && rm -Rf /var/lib/apt/lists/* && apt-get -y update
+
+RUN apt-get install -y nodejs
+RUN apt-get install -y npm
+RUN npm config set registry http://registry.npm.taobao.org
+
+RUN npm install -g create-react-app
+
+CMD ["/bin/bash" ,"-c" ,"while true;do echo hello docker;sleep 1;done"]

+ 5 - 0
client/package.json

@@ -0,0 +1,5 @@
+{
+  "name": "client",
+  "version": "0.1.0",
+  "private": true
+}

+ 10 - 0
docker-compose.yml

@@ -0,0 +1,10 @@
+version: '2.1'
+
+services:
+  react-note:
+    image: qhedu/nodejs:1.0.1
+    build: .
+    ports:
+      - 3000:3000
+    volumes:
+      - "./:/root/app"