File tree Expand file tree Collapse file tree 6 files changed +126
-12
lines changed Expand file tree Collapse file tree 6 files changed +126
-12
lines changed Original file line number Diff line number Diff line change 1
- FROM node:19-alpine
1
+ # Stage 1: Build
2
+ FROM node:19-alpine as build
2
3
3
- # python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
4
+ # python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
4
5
RUN apk add --no-cache --virtual .gyp \
5
6
python3 \
6
7
make \
7
- g++
8
+ g++
8
9
9
10
WORKDIR /app
10
11
11
12
COPY package*.json ./
12
13
13
- COPY app/dist /app
14
+ RUN npm install --no-install-recommends
14
15
15
- COPY .env .env
16
+ COPY . .
16
17
17
- COPY server ./server
18
+ # Stage 2: Node Server
19
+ FROM node:19-alpine as node_server
18
20
19
- COPY config.js ./config.js
21
+ WORKDIR /app
20
22
21
- RUN npm install --no-install-recommends
23
+ COPY --from=build /app/package*.json ./
24
+
25
+ RUN npm install --no-install-recommends --only=production
26
+
27
+ COPY --from=build /app/.env .env
28
+ COPY --from=build /app/config.js ./config.js
29
+ COPY --from=build /app/server ./server
22
30
23
31
EXPOSE 5656
24
32
25
33
ENV IS_DOCKER true
26
34
27
35
CMD [ "npm" , "start" ]
28
36
29
- # create docker image: "docker build -t reactype-container ." Note: if you want reactype-container with a different name (must be all lowercase)
30
- # run docker container: "docker run -d -p 5656:5656 reactype-container" docker run -d -p 5656:5656 reactype-v15
31
- # comment out window.api.formatCode(), but will break it for electron app.
37
+ # Stage 3: Nginx Server
38
+ FROM nginx:alpine as nginx_server
39
+
40
+ # Copy the build output to the Nginx html directory
41
+ COPY --from=build /app/app/dist /usr/share/nginx/html
42
+
43
+ # Copy the Nginx configuration file
44
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
45
+
46
+ EXPOSE 80
47
+
48
+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change
1
+ FROM node:19-alpine
2
+
3
+ #python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
4
+ RUN apk add --no-cache --virtual .gyp \
5
+ python3 \
6
+ make \
7
+ g++
8
+
9
+ WORKDIR /app
10
+
11
+ COPY package*.json ./
12
+
13
+ COPY app/dist /app
14
+
15
+ COPY .env .env
16
+
17
+ COPY server ./server
18
+
19
+ COPY config.js ./config.js
20
+
21
+ RUN npm install --no-install-recommends
22
+
23
+ EXPOSE 5656
24
+
25
+ ENV IS_DOCKER true
26
+
27
+ CMD [ "npm", "start" ]
28
+
29
+ # create docker image: "docker build -t reactype-container ." Note: if you want reactype-container with a different name (must be all lowercase)
30
+ # run docker container: "docker run -d -p 5656:5656 reactype-container" docker run -d -p 5656:5656 reactype-v15
31
+ # comment out window.api.formatCode(), but will break it for electron app.
Original file line number Diff line number Diff line change
1
+ # Stage 1: Build
2
+ FROM node:19-alpine as build
3
+
4
+ # python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
5
+ RUN apk add --no-cache --virtual .gyp \
6
+ python3 \
7
+ make \
8
+ g++
9
+
10
+ WORKDIR /app
11
+
12
+ COPY package*.json ./
13
+
14
+ RUN npm install --no-install-recommends
15
+
16
+ COPY . .
17
+
18
+ # Stage 2: Runtime
19
+ FROM node:19-alpine as runtime
20
+
21
+ WORKDIR /app
22
+
23
+ COPY --from=build /app/package*.json ./
24
+
25
+ RUN npm install --no-install-recommends --only=production
26
+
27
+ COPY --from=build /app/.env .env
28
+ COPY --from=build /app/config.js ./config.js
29
+ COPY --from=build /app/server ./server
30
+ COPY --from=build /app/app/dist /app
31
+
32
+ EXPOSE 5656
33
+
34
+ ENV IS_DOCKER true
35
+
36
+ CMD [ "npm", "start" ]
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ function navbarDropDown () {
132
132
dispatch ( toggleDarkMode ( ) ) ;
133
133
// Add your logic to update the style and theme based on darkMode
134
134
isDarkMode ? dispatch ( setStyle ( null ) ) : dispatch ( setStyle ( { backgroundColor : '#21262c' } ) ) ;
135
- props . setTheme ( isDarkMode ) ;
135
+ // props.setTheme(isDarkMode);
136
136
} ;
137
137
138
138
const handleClose = ( ) => {
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+
3
+ services :
4
+ web :
5
+ build :
6
+ context : .
7
+ target : nginx_server
8
+ ports :
9
+ - ' 80:80'
10
+ api :
11
+ build :
12
+ context : .
13
+ target : node_server
14
+ ports :
15
+ - ' 5656:5656'
Original file line number Diff line number Diff line change
1
+ server {
2
+ listen 80 ;
3
+ server_name localhost;
4
+
5
+ location / {
6
+ root /usr/share/nginx/html;
7
+ index index-prod.html index.htm;
8
+ try_files $uri $uri / /index-prod.html;
9
+ }
10
+
11
+ error_page 500 502 503 504 /50x.html;
12
+ location = /50x.html {
13
+ root /usr/share/nginx/html;
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments