IntersysConsulting / ingangsters-web

0 stars 0 forks source link

Dockerize Front (React) #11

Closed martin-one closed 5 years ago

jogadev commented 5 years ago

There is a problem: I want to create a real-time development environment with Docker, so we can edit our code and it would be automatically refreshed within the container. To do so, we use volumes, but the problem is that out Azure credentials won't give Docker the proper permissions to create volumes.

martin-one commented 5 years ago

https://tomssl.com/2018/01/11/sharing-your-c-drive-with-docker-for-windows-when-using-azure-active-directory-azuread-aad/ This one worked for me. (grant access to C in docker)

sofia-robles-Intersys commented 5 years ago

Dockerfile.txt

Me comento Edgardo que la linea que dice: RUN npm install -g create-react-app no es necesaria si la aplicación ya está creada.

sofia-robles-Intersys commented 5 years ago

Para construir la imagen ejecutar docker build -t react_test .

Para correr el contenedor docker run -p 3000:3000 -v ${PWD}:/app -v /app/node_modules react_test

jogadev commented 5 years ago

Dockerfile

FROM node

WORKDIR /app

COPY . /app

RUN npm i

ENV CHOKIDAR_USEPOLLING true

CMD ["npm","start"]

.dockerignore

*
!package.json
!package-lock.json
!/src
!/public