Commit 7855c68 1 parent 781e38d commit 7855c68 Copy full SHA for 7855c68
File tree 8 files changed +19
-33
lines changed
8 files changed +19
-33
lines changed Original file line number Diff line number Diff line change 1
- USE_ENVIRONMENT_CONFIG = true
1
+ REACT_APP_USE_ENVIRONMENT_CONFIG=false
2
+ REACT_APP_TIMEOUT_SPAN=300000
3
+ REACT_APP_APP_ID=admin
2
4
REACT_APP_LOCALHOST=https://app.cenit.io
3
5
REACT_APP_CENIT_HOST=https://server.cenit.io
4
- TIMEOUT_SPAN = 300000
5
- REACT_APP_APP_ID = admin
Original file line number Diff line number Diff line change 13
13
14
14
# misc
15
15
.DS_Store
16
- .env.local
17
- .env.development.local
18
- .env.test.local
19
- .env.production.local
16
+ .env *
20
17
21
18
# IDEs and editors
22
19
/.idea
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ COPY package-lock.json .
8
8
RUN npm install -g npm@latest
9
9
RUN npm ci --silent
10
10
RUN npm install react-scripts --production -g --silent
11
- COPY . .
11
+ COPY env.sh .
12
+ COPY src src/
13
+ COPY public public/
14
+ COPY conf conf/
12
15
RUN npm run build
13
16
14
17
# => Run container
@@ -20,6 +23,6 @@ COPY --from=builder /app/build /usr/share/nginx/html/
20
23
EXPOSE 80
21
24
WORKDIR /usr/share/nginx/html
22
25
COPY ./env.sh .
23
- COPY .env .
26
+ COPY .env.docker .env
24
27
RUN chmod +x env.sh
25
28
CMD ["/bin/sh" , "-c" , "/usr/share/nginx/html/env.sh && nginx -g \" daemon off;\" " ]
Original file line number Diff line number Diff line change @@ -39,6 +39,6 @@ And that's all!
39
39
docker run -dti -e REACT_APP_LOCALHOST=http://127.0.0.1:3001 \
40
40
-e REACT_APP_CENIT_HOST=http://127.0.0.1:3000 \
41
41
-p 3000:80 \
42
- --name container_name ghcr.io/cenit-io/ui:latest
42
+ --name cenit-ui ghcr.io/cenit-io/ui:latest
43
43
```
44
44
Navigate to http://localhost:3000/ in your browser to view the app.
Original file line number Diff line number Diff line change 4
4
This is a React application for the administration of a Cenit Platform instance, that is currently under development.
5
5
Follow these instructions to configure a local instance of Cenit and connect it as a backend for the app.
6
6
7
- ## Configuring the Admin App
8
-
9
- Update public/config.js
10
-
11
- ```
12
- window.appConfig = {
13
- USE_ENVIRONMENT_CONFIG: "true",
14
- REACT_APP_LOCALHOST: "http://127.0.0.1:3000",
15
- REACT_APP_CENIT_HOST: "http://127.0.0.1:3001",
16
- TIMEOUT_SPAN: "300000",
17
- REACT_APP_APP_ID: "admin",
18
- }
19
- ```
20
-
21
7
## Configuring the Backend
22
8
23
9
1 . Make sure the Cenit ** local repository is up to date with the remote** . The developed branch of Cenit
@@ -78,9 +64,9 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
78
64
### Run with Docker
79
65
80
66
```
81
- docker run -dti -e REACT_APP_LOCALHOST=http://127.0.0.1:3001 \
82
- -e REACT_APP_CENIT_HOST=http://127.0.0.1:3000 \
67
+ docker run -dti -e REACT_APP_LOCALHOST=http://127.0.0.1:3000 \
68
+ -e REACT_APP_CENIT_HOST=http://127.0.0.1:3001 \
83
69
-p 3000:80 \
84
- -- t cenit-ui:latest
70
+ -t cenit-ui:latest
85
71
```
86
72
Navigate to http://localhost:3000/ in your browser to view the app.
Original file line number Diff line number Diff line change 38
38
"sortablejs" : " ^1.12.0"
39
39
},
40
40
"scripts" : {
41
- "start" : " chmod +x ./env.sh && ./env.sh && cp config.js ./public/ && react-scripts start" ,
41
+ "start" : " react-scripts start" ,
42
42
"build" : " react-scripts build" ,
43
43
"test" : " react-scripts test" ,
44
44
"eject" : " react-scripts eject"
Original file line number Diff line number Diff line change 1
1
window . appConfig = {
2
- USE_ENVIRONMENT_CONFIG : "true" ,
2
+ REACT_APP_USE_ENVIRONMENT_CONFIG : "true" ,
3
+ REACT_APP_TIMEOUT_SPAN : "300000" ,
4
+ REACT_APP_APP_ID : "admin" ,
3
5
REACT_APP_LOCALHOST : "https://app.cenit.io" ,
4
6
REACT_APP_CENIT_HOST : "https://server.cenit.io" ,
5
- TIMEOUT_SPAN : "300000" ,
6
- REACT_APP_APP_ID : "admin" ,
7
- }
7
+ } ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const EnvironmentProcessConfig = {
19
19
appIdentifier : process . env . REACT_APP_APP_ID
20
20
} ;
21
21
22
- export const Config = AppConfig . USE_ENVIRONMENT_CONFIG == " true" ? EnvironmentAppConfig : EnvironmentProcessConfig ;
22
+ export const Config = AppConfig . REACT_APP_USE_ENVIRONMENT_CONFIG === ' true' ? EnvironmentProcessConfig : EnvironmentAppConfig ;
23
23
24
24
export const CenitHostKey = 'cenitHost' ;
25
25
You can’t perform that action at this time.
0 commit comments