Browse Source

update docker-compose

pull/2/head
archaict 2 years ago
parent
commit
70d68fe32c
  1. 12
      Dockerfile
  2. 10
      docker-compose.yml

12
Dockerfile

@ -7,4 +7,14 @@ RUN npm i react@16.14.0
RUN npm i react-scripts RUN npm i react-scripts
RUN npm audit fix RUN npm audit fix
CMD npm start --host 0.0.0.0 --port 3000 --disableHostCheck true EXPOSE 8445
# Comment as needed (Production / Dev)
# [PROD] Use for Production
# COPY . . # uncomment prod
# [DEV] Live Reload
RUN mkdir -p /react-docker/src # comment for prod
RUN mkdir -p /react-docker/public # comment for prod
CMD PORT=8445 npm start #--host 0.0.0.0 --port 3000 --disableHostCheck true

10
docker-compose.yml

@ -1,14 +1,16 @@
version: "3.9" version: "3.3"
services: services:
frontend: frontend:
container_name: ADW-Frontend container_name: ADW-Frontend
tty: true
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
working_dir: /react-docker
volumes: volumes:
- ./:/react-docker:delegated - ./src:/react-docker/src
- /node_modules - ./public:/react-docker/public
ports: ports:
- 3000:3000 - 8445:8445
environment: environment:
- CHOKIDAR_USEPOLLING=true - CHOKIDAR_USEPOLLING=true

Loading…
Cancel
Save