Deployment instruction using docker added
This commit is contained in:
parent
1813e6ae02
commit
42dd806185
30
README.md
30
README.md
@ -1,2 +1,32 @@
|
||||
# Build-a-Random-Quote-Machine
|
||||
|
||||
**Profile:** [https://www.freecodecamp.org/radii](https://www.freecodecamp.org/radii)
|
||||
|
||||
**Project specification:** [Build a Random Quote Machine](https://www.freecodecamp.org/learn/front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine)
|
||||
|
||||
**[Tests](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js)**
|
||||
|
||||
## Build and deploy as:
|
||||
|
||||
```{bash}
|
||||
cd random-quote-machine
|
||||
npm install
|
||||
npm run build
|
||||
cd ..
|
||||
docker build -t radii/random-quote-machine:latest -f ./dockerfile .
|
||||
docker run -p 8081:80 -it radii/random-quote-machine
|
||||
```
|
||||
|
||||
## Run tests as:
|
||||
After building, go to to `build` sub-directory and edit `index.html` file and insert bellow code snippet immediately before closing `</body>` tag:
|
||||
|
||||
```{html}
|
||||
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>`
|
||||
```
|
||||
|
||||
Than serve as:
|
||||
|
||||
```{bash}
|
||||
serve -s build
|
||||
```
|
||||
You should now see a hamburger on left of page. Tap/click it than select test suite `Random Quote Machine`. `Run Tests` and observe results.
|
||||
|
4
dockerfile
Normal file
4
dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM nginx
|
||||
|
||||
COPY nginx.conf /
|
||||
COPY random-quote-machine/build /usr/share/nginx/html
|
584
random-quote-machine/tests/bundle.js
Normal file
584
random-quote-machine/tests/bundle.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user