From 858c047f7a55c18fb709e0f99afc0220782c0592 Mon Sep 17 00:00:00 2001 From: Yutsuo Date: Tue, 28 Jan 2020 13:04:32 -0300 Subject: [PATCH] update --- .dockerignore | 24 ++++++++++++++++++++++++ Dockerfile | 16 ++++++++++++++++ docker-compose.debug.yml | 10 ++++++++++ docker-compose.proxy.yml | 31 +++++++++++++++++++++++++++++++ docker-compose.yml | 31 +++++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.debug.yml create mode 100644 docker-compose.proxy.yml create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..257cb48 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc255f2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# base image +FROM node:alpine + +# set working directory +WORKDIR /app + +# add `/app/node_modules/.bin` to $PATH +ENV PATH /app/node_modules/.bin:$PATH + +# install and cache app dependencies +COPY package.json /app/package.json +RUN npm install --silent +RUN npm install react-scripts@3.0.1 -g --silent + +# start app +CMD ["npm", "start"] diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml new file mode 100644 index 0000000..9c44155 --- /dev/null +++ b/docker-compose.debug.yml @@ -0,0 +1,10 @@ +version: '2.1' + +services: + mern-todo-app: + image: mern-todo-app + build: + context: . + dockerfile: Dockerfile + ports: + - 3002:3002 \ No newline at end of file diff --git a/docker-compose.proxy.yml b/docker-compose.proxy.yml new file mode 100644 index 0000000..fed09f4 --- /dev/null +++ b/docker-compose.proxy.yml @@ -0,0 +1,31 @@ +version: "3.7" +services: + react: + image: yutsuo/mern-todo-app + container_name: mern-todo-app + build: + context: . + args: + - HTTP_PROXY=http://192.168.128.1:3128 + - HTTPS_PROXY=http://192.168.128.1:3128 + - http_proxy=http://192.168.128.1:3128 + - https_proxy=http://192.168.128.1:3128 + ports: + - "3000:3000" + volumes: + - .:/app + - /app/node_modules + environment: + - PORT=3000 + - HTTP_PROXY=http://192.168.128.1:3128 + - HTTPS_PROXY=http://192.168.128.1:3128 + - http_proxy=http://192.168.128.1:3128 + - https_proxy=http://192.168.128.1:3128 + - NODE_ENV=development + +networks: + default: + ipam: + driver: default + config: + - subnet: 172.17.0.0/24 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fed09f4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: "3.7" +services: + react: + image: yutsuo/mern-todo-app + container_name: mern-todo-app + build: + context: . + args: + - HTTP_PROXY=http://192.168.128.1:3128 + - HTTPS_PROXY=http://192.168.128.1:3128 + - http_proxy=http://192.168.128.1:3128 + - https_proxy=http://192.168.128.1:3128 + ports: + - "3000:3000" + volumes: + - .:/app + - /app/node_modules + environment: + - PORT=3000 + - HTTP_PROXY=http://192.168.128.1:3128 + - HTTPS_PROXY=http://192.168.128.1:3128 + - http_proxy=http://192.168.128.1:3128 + - https_proxy=http://192.168.128.1:3128 + - NODE_ENV=development + +networks: + default: + ipam: + driver: default + config: + - subnet: 172.17.0.0/24