Skip to content

Commit 6af92ef

Browse files
authored
Merge pull request #6 from icaropires/master
Adiciona app react de exemplo
2 parents 8b8d750 + 54f273c commit 6af92ef

24 files changed

Lines changed: 11701 additions & 0 deletions

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

demo-react-app/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_BASE_URL=http://localhost

demo-react-app/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_BASE_URL=https://myurl.com.br

demo-react-app/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# React app demo repository
2+
3+
App react simples criado com o [create react app](https://reactjs.org/docs/create-a-new-react-app.html) e com adições de arquivos Docker para exemplo em aula.

demo-react-app/docker/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM node:alpine3.12 as base
2+
3+
WORKDIR /app/
4+
5+
RUN npx create-react-app my-app \
6+
&& cd /app/my-app
7+
8+
WORKDIR /app/my-app
9+
10+
ENTRYPOINT ["/usr/local/bin/yarn"]
11+
12+
CMD ["start"]
13+
14+
15+
FROM base as prod
16+
17+
ADD . .
18+
19+
RUN yarn add serve \
20+
&& yarn build
21+
22+
ENTRYPOINT [] # Removendo o yarn como entrypoint
23+
24+
CMD ["/app/my-app/node_modules/serve/bin/serve.js", "-s", "build"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
my-app:
3+
build:
4+
target: prod
5+
image: 4linux-lab:prod
6+
ports:
7+
- 80:5000
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
my-app:
3+
ports:
4+
- 3000:3000
5+
volumes:
6+
- ..:/app/my-app
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
my-app:
3+
build:
4+
context: ..
5+
dockerfile: docker/Dockerfile
6+
target: base
7+
image: 4linux-lab

demo-react-app/package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "my-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^5.11.4",
7+
"@testing-library/react": "^11.1.0",
8+
"@testing-library/user-event": "^12.1.10",
9+
"react": "^17.0.1",
10+
"react-dom": "^17.0.1",
11+
"react-scripts": "4.0.3",
12+
"web-vitals": "^1.0.1"
13+
},
14+
"scripts": {
15+
"start": "react-scripts start",
16+
"build": "react-scripts build",
17+
"test": "react-scripts test",
18+
"eject": "react-scripts eject"
19+
},
20+
"eslintConfig": {
21+
"extends": [
22+
"react-app",
23+
"react-app/jest"
24+
]
25+
},
26+
"browserslist": {
27+
"production": [
28+
">0.2%",
29+
"not dead",
30+
"not op_mini all"
31+
],
32+
"development": [
33+
"last 1 chrome version",
34+
"last 1 firefox version",
35+
"last 1 safari version"
36+
]
37+
}
38+
}

demo-react-app/public/favicon.ico

3.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)