Skip to content

Commit 5fe400e

Browse files
authored
Merge pull request #69 from alexisluque/add-docker
Dockerize all samples
2 parents e7ce5f6 + f8c59e4 commit 5fe400e

27 files changed

Lines changed: 166 additions & 11 deletions

01-Login/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package-lock.json
2+
node_modules
3+
.gitignore
4+
exec.sh
5+
exec.ps1
6+
README.md

01-Login/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:8.7-alpine
2+
3+
WORKDIR /home/app
4+
5+
RUN npm install -g create-react-app
6+
ADD package.json /home/app
7+
RUN npm install
8+
ADD . /home/app
9+
10+
CMD ["npm", "start"]
11+
12+
EXPOSE 3000

01-Login/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This sample demonstrates how to add authentication to a React application with A
44

55
## Getting Started
66

7-
If you haven't already done so, [sign up](https://auth0.com) for your free Auth0 account and create a new client in the [dashboard](https://manage.auth0.com). Find the **domain** and **client ID** from the settings area and add the URL for your application to the **Allowed Callback URLs** box. If you are using the server provided by the create-react-app, that URL is `http://localhost:3000`.
7+
If you haven't already done so, [sign up](https://auth0.com) for your free Auth0 account and create a new client in the [dashboard](https://manage.auth0.com). Find the **domain** and **client ID** from the settings area and add the URL for your application to the **Allowed Callback URLs** box. If you are using the server provided by the create-react-app, that URL is `http://localhost:3000/callback`.
88

99
Clone the repo or download it from the React quickstart page in Auth0's documentation. Install create-react-app globally and the dependencies for the app.
1010

@@ -30,6 +30,14 @@ npm start
3030

3131
The application will be served at `http://localhost:3000`.
3232

33+
## Run the Application With Docker
34+
35+
In order to run the example with docker you need to have `docker` installed.
36+
37+
You also need to set the environment variables as explained [previously](#set-the-client-id-and-domain).
38+
39+
Execute in command line `sh exec.sh` to run the Docker in Linux, or `.\exec.ps1` to run the Docker in Windows.
40+
3341
## What is Auth0?
3442

3543
Auth0 helps you to:
@@ -52,7 +60,7 @@ If you have found a bug or if you have a feature request, please report them at
5260

5361
## Author
5462

55-
[Auth0](auth0.com)
63+
[Auth0](https://auth0.com)
5664

5765
## License
5866

01-Login/exec.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docker build -t auth0-react-01-login .
2+
docker run -p 3000:3000 -it auth0-react-01-login

01-Login/exec.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
docker build -t auth0-react-01-login .
3+
docker run -p 3000:3000 -it auth0-react-01-login

02-User-Profile/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package-lock.json
2+
node_modules
3+
.gitignore
4+
exec.sh
5+
exec.ps1
6+
README.md

02-User-Profile/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:8.7-alpine
2+
3+
WORKDIR /home/app
4+
5+
RUN npm install -g create-react-app
6+
ADD package.json /home/app
7+
RUN npm install
8+
ADD . /home/app
9+
10+
CMD ["npm", "start"]
11+
12+
EXPOSE 3000

02-User-Profile/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This sample demonstrates how to get a user's profile using Auth0 in a React appl
44

55
## Getting Started
66

7-
If you haven't already done so, [sign up](https://auth0.com) for your free Auth0 account and create a new client in the [dashboard](https://manage.auth0.com). Find the **domain** and **client ID** from the settings area and add the URL for your application to the **Allowed Callback URLs** box. If you are using the server provided by the create-react-app, that URL is `http://localhost:3000`.
7+
If you haven't already done so, [sign up](https://auth0.com) for your free Auth0 account and create a new client in the [dashboard](https://manage.auth0.com). Find the **domain** and **client ID** from the settings area and add the URL for your application to the **Allowed Callback URLs** box. If you are using the server provided by the create-react-app, that URL is `http://localhost:3000/callback`.
88

99
Clone the repo or download it from the React quickstart page in Auth0's documentation. Install create-react-app globally and the dependencies for the app.
1010

@@ -30,6 +30,14 @@ npm start
3030

3131
The application will be served at `http://localhost:3000`.
3232

33+
## Run the Application With Docker
34+
35+
In order to run the example with docker you need to have `docker` installed.
36+
37+
You also need to set the environment variables as explained [previously](#set-the-client-id-and-domain).
38+
39+
Execute in command line `sh exec.sh` to run the Docker in Linux, or `.\exec.ps1` to run the Docker in Windows.
40+
3341
## What is Auth0?
3442

3543
Auth0 helps you to:
@@ -52,7 +60,7 @@ If you have found a bug or if you have a feature request, please report them at
5260

5361
## Author
5462

55-
[Auth0](auth0.com)
63+
[Auth0](https://auth0.com)
5664

5765
## License
5866

02-User-Profile/exec.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docker build -t auth0-react-02-user-profile .
2+
docker run -p 3000:3000 -it auth0-react-02-user-profile

02-User-Profile/exec.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
docker build -t auth0-react-02-user-profile .
3+
docker run -p 3000:3000 -it auth0-react-02-user-profile

0 commit comments

Comments
 (0)