Last active
December 5, 2018 20:26
-
-
Save abdullahceylan/68fb2318382ae57831bbd3ff6460b296 to your computer and use it in GitHub Desktop.
create-react-app Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.5' | |
services: | |
sample-app: | |
container_name: calculator | |
build: | |
context: . | |
dockerfile: Dockerfile | |
volumes: | |
- '.:/usr/src/app' | |
- '/usr/src/app/node_modules' | |
ports: | |
- '3000:3000' | |
environment: | |
- NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# base image | |
FROM node:9.6.1 | |
# set working directory | |
RUN mkdir /usr/src/app | |
WORKDIR /usr/src/app | |
# add `/usr/src/app/node_modules/.bin` to $PATH | |
ENV PATH /usr/src/app/node_modules/.bin:$PATH | |
# install and cache app dependencies | |
COPY package.json /usr/src/app/package.json | |
RUN npm install --silent | |
RUN npm install react-scripts@1.1.1 -g --silent | |
# start app | |
CMD ["npm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment