Skip to content

Instantly share code, notes, and snippets.

@azam
Last active January 12, 2017 04:05
Show Gist options
  • Save azam/f2b46dc46205a543d559236f8280a1ec to your computer and use it in GitHub Desktop.
Save azam/f2b46dc46205a543d559236f8280a1ec to your computer and use it in GitHub Desktop.
Dockerfile for create-react-app, since I don't want to polute my node global modules. Creates a temporary project on build and removes it afterward, to cache the latest packages on build-time. Build: `docker build -t azam/create-react-app`. Usage: `docker run --rm -v $PWD:/project azam/create-react-app my-project-name`
FROM node:6-alpine
RUN npm install -g create-react-app \
&& mkdir /project \
&& cd /project \
&& /usr/local/bin/create-react-app tmp-project \
&& rm -rf ./tmp-project
WORKDIR /project
ENTRYPOINT ["/usr/local/bin/create-react-app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment