Browse Source

update docker-compose

pull/2/head
archaict 2 years ago
parent
commit
1a21c192c5
  1. 14
      Dockerfile
  2. 15
      docker-compose.yml

14
Dockerfile

@ -1,10 +1,10 @@
# FROM node:8.10-alpine
FROM node:12 FROM node:12
WORKDIR /usr/src/app WORKDIR /react-docker
COPY package.json ./ COPY ./package*.json ./
# RUN apt install git python3 ENV PATH /app/node_modules/.bin:$PATH
RUN npm install --only=production RUN npm install
RUN npm i react@16.14.0 RUN npm i react@16.14.0
RUN npm i react-scripts
RUN npm audit fix RUN npm audit fix
COPY . .
CMD [ "npm", "start" ] CMD npm start --host 0.0.0.0 --port 3000 --disableHostCheck true

15
docker-compose.yml

@ -1,9 +1,14 @@
version: "3.9" version: "3.9"
services: services:
frontend: frontend:
container_name: frontend-adw container_name: ADW-Frontend
restart: unless-stopped build:
build: Dockerfile context: .
dockerfile: Dockerfile
volumes:
- ./:/react-docker:delegated
- /node_modules
ports: ports:
- "3000:3000" - 3000:3000
stdin_open: true environment:
- CHOKIDAR_USEPOLLING=true

Loading…
Cancel
Save