sdy

create docker-compose.yml and Dockerfile

1 +FROM node:14.16.1-alpine
2 +
3 +WORKDIR /app
4 +
5 +ENV PATH /app/node_modules/.bin:$PATH
6 +
7 +COPY package.json /app/package.json
8 +COPY package-lock.json /app/package-lock.json
9 +RUN npm install
10 +RUN npm install react-scripts@3.0.1 -g
11 +
12 +CMD ["npm", "start"]
1 +version: '3.8'
2 +services:
3 + elasticsearch:
4 + image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
5 + container_name: elasticsearch
6 + environment:
7 + - "discovery.type=single-node"
8 + ports:
9 + - 9200:9200
10 + volumes:
11 + - es_data:/usr/share/elasticsearch/data
12 + kibana:
13 + image: docker.elastic.co/kibana/kibana:7.12.1
14 + container_name: kibana
15 + environment:
16 + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
17 + ports:
18 + - 5601:5601
19 + depends_on:
20 + - elasticsearch
21 + web:
22 + container_name: react
23 + build:
24 + context: .
25 + dockerfile: Dockerfile
26 + volumes:
27 + - ".:/app"
28 + - "/app/node_modules"
29 + ports:
30 + - "3001:3000"
31 + environment:
32 + - NODE_ENV=development
33 + stdin_open: true
34 + tty: true
35 +
36 +volumes:
37 + es_data:
38 + driver: local
......