Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adding docker support, including a prod and dev version
  • Loading branch information
robertglenn committed Dec 27, 2017
commit a6f166f68c0ef987979f7ada8314f8cc3b2875e0
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:8-alpine as builder

WORKDIR /code/

EXPOSE 3000

COPY . .

RUN npm install

ENTRYPOINT npm run start
18 changes: 18 additions & 0 deletions Dockerfile-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:8-alpine as builder

WORKDIR /code/

EXPOSE 3000

COPY . .

RUN npm install --unsafe-perm

RUN npm run build


FROM nginx

WORKDIR /usr/share/nginx/html

COPY --from=builder /code/build .
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ For more info, visit [Protected routes and authentication with React Router v4](
* ```npm install```
* ```npm start```
* Visit ```localhost:3000```

#### Try it out in a [Docker](https://www.docker.com/) container:
* Run a container running the prod version: `docker run -p 8080:80 -d allthethings/react-router-firebase-auth`
* Or build a dev version, locally: `docker build -t react-router-firebase-auth .`
* Then run the image (listens for changes to src): `docker run -v "$(pwd)/src:/code/src" -p 3000:3000 -d --name react-router-firebase-auth react-router-firebase-auth`