diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..56e8146 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +build +.dockerignore +Dockerfile +Dockerfile.prod \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bbbe6cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# pull official base image +FROM node:13.12.0-alpine + +# set working directory +WORKDIR /app + +# add `/app/node_modules/.bin` to $PATH +ENV PATH /app/node_modules/.bin:$PATH + +# install app dependencies +COPY package.json ./ +COPY package-lock.json ./ +RUN npm install --silent +RUN npm install react-scripts@3.4.1 -g --silent + +# add app +COPY . ./ + +# start app +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..623893a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.7' + +services: + + sample: + container_name: gonito + build: + context: . + dockerfile: Dockerfile + # volumes: + # - '.:/app' + # - '/app/node_modules' + ports: + - 3001:3000 + environment: + - CHOKIDAR_USEPOLLING=true \ No newline at end of file