From 1a21c192c5ec68632977fb746274589a7795b636 Mon Sep 17 00:00:00 2001 From: archaict Date: Fri, 12 Aug 2022 22:25:35 +0700 Subject: [PATCH] update docker-compose --- Dockerfile | 14 +++++++------- docker-compose.yml | 15 ++++++++++----- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0ee6dac..0a60c97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -# FROM node:8.10-alpine FROM node:12 -WORKDIR /usr/src/app -COPY package.json ./ -# RUN apt install git python3 -RUN npm install --only=production +WORKDIR /react-docker +COPY ./package*.json ./ +ENV PATH /app/node_modules/.bin:$PATH +RUN npm install RUN npm i react@16.14.0 +RUN npm i react-scripts RUN npm audit fix -COPY . . -CMD [ "npm", "start" ] \ No newline at end of file + +CMD npm start --host 0.0.0.0 --port 3000 --disableHostCheck true diff --git a/docker-compose.yml b/docker-compose.yml index cc29bd8..fa276e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,14 @@ version: "3.9" services: frontend: - container_name: frontend-adw - restart: unless-stopped - build: Dockerfile + container_name: ADW-Frontend + build: + context: . + dockerfile: Dockerfile + volumes: + - ./:/react-docker:delegated + - /node_modules ports: - - "3000:3000" - stdin_open: true + - 3000:3000 + environment: + - CHOKIDAR_USEPOLLING=true