diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0f1aa2e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:18-alpine +WORKDIR '/app' + +COPY package.json . +RUN npm install + +COPY . . + +CMD ["npm","run","dev","-- --open"] + + +EXPOSE 3000 +# if facing error while building image, paste there two command in terminal. + +# export DOCKER_BUILDKIT=0 +#export COMPOSE_DOCKER_CLI_BUILD=0 \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..53a85f0 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,20 @@ +version: '3' +services: + react-app: + restart: always + build: + context: ./ + dockerfile: Dockerfile + image: app-write + stdin_open: true + ports: + - '3000:3000' + networks: + - app + volumes: + - ./src:/app/src + - ./app/node_modules + +networks: + app: + driver: bridge