sdy

create docker-compose.yml and Dockerfile

FROM node:14.16.1-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
RUN npm install
RUN npm install react-scripts@3.0.1 -g
CMD ["npm", "start"]
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
container_name: elasticsearch
environment:
- "discovery.type=single-node"
ports:
- 9200:9200
volumes:
- es_data:/usr/share/elasticsearch/data
kibana:
image: docker.elastic.co/kibana/kibana:7.12.1
container_name: kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- 5601:5601
depends_on:
- elasticsearch
web:
container_name: react
build:
context: .
dockerfile: Dockerfile
volumes:
- ".:/app"
- "/app/node_modules"
ports:
- "3001:3000"
environment:
- NODE_ENV=development
stdin_open: true
tty: true
volumes:
es_data:
driver: local
......