File tree Expand file tree Collapse file tree 4 files changed +35
-15
lines changed Expand file tree Collapse file tree 4 files changed +35
-15
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ jspm_packages/
87
87
build /
88
88
release-builds /
89
89
90
- .docker-compose.yml
91
- .Dockerfile-2stage
90
+ .docker-compose-nginx .yml
91
+ .Dockerfile-1stage
92
92
.Dockerfile-nginx
93
93
94
94
# TypeScript v1 declaration files
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: Runtime
19
+ FROM node:19-alpine as runtime
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
30
+ COPY --from=build /app/app/dist /app
22
31
23
32
EXPOSE 5656
24
33
25
34
ENV IS_DOCKER true
26
35
27
36
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
- <!doctype html> < html lang ="en-US "> < head > < meta charset ="UTF-8 "/> < script src ="https://kit.fontawesome.com/7e1cebd082.js " crossorigin ="anonymous "> </ script > < meta property ="csp-nonce " content ="NTVhMWZiNjQtNTNiMi00NTE3LTkwMDItMTdmZWJlMzJkOTZk "/> < title > ReacType</ title > < link href ="main.css " rel ="stylesheet "> </ head > < body > < div id ="app "> </ div > < script src ="bundle.js "> </ script > </ body > </ html >
1
+ <!doctype html> < html lang ="en-US "> < head > < meta charset ="UTF-8 "/> < script src ="https://kit.fontawesome.com/7e1cebd082.js " crossorigin ="anonymous "> </ script > < meta property ="csp-nonce " content ="MGMzMmNhN2QtOGMxZi00YTllLTlhODQtMGM0ZWMxYTE4ZGJh "/> < title > ReacType</ title > < link href ="main.css " rel ="stylesheet "> </ head > < body > < div id ="app "> </ div > < script src ="bundle.js "> </ script > </ body > </ html >
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+
3
+ services :
4
+ web :
5
+ build :
6
+ context : .
7
+ target : runtime
8
+ ports :
9
+ - ' 80:80'
10
+ api :
11
+ build :
12
+ context : .
13
+ target : build
14
+ ports :
15
+ - ' 5656:5656'
You can’t perform that action at this time.
0 commit comments