Skip to content

Commit e1cb35a

Browse files
committed
testing deployment
1 parent 34d8dd6 commit e1cb35a

File tree

5 files changed

+49
-49
lines changed

5 files changed

+49
-49
lines changed

Dockerfile

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
# Stage 1: Build
2-
FROM node:19-alpine as build
1+
FROM node:19-alpine
32

4-
# python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
3+
#python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
54
RUN apk add --no-cache --virtual .gyp \
65
python3 \
76
make \
8-
g++
7+
g++
98

109
WORKDIR /app
1110

1211
COPY package*.json ./
1312

14-
RUN npm install --no-install-recommends
15-
16-
COPY . .
17-
18-
# Stage 2: Runtime
19-
FROM node:19-alpine as runtime
13+
COPY app/dist /app
2014

21-
WORKDIR /app
15+
COPY .env .env
2216

23-
COPY --from=build /app/package*.json ./
17+
COPY server ./server
2418

25-
RUN npm install --no-install-recommends --only=production
19+
COPY config.js ./config.js
2620

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
21+
RUN npm install --no-install-recommends
3122

3223
EXPOSE 5656
3324

3425
ENV IS_DOCKER true
3526

3627
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.

Dockerfile-1stage

Lines changed: 0 additions & 31 deletions
This file was deleted.

Dockerfile-2stage

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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" ]

app/dist/index-prod.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
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="YjQ2ODQzZDEtY2NkMS00YWZjLWE2MTAtMWM5Yzc5OThiMmEz"/><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="MGQ4YmNkYjEtMGU4ZS00MmU5LWIyYWItZmUyMmVkZTY2YzQx"/><title>ReacType</title><link href="main.css" rel="stylesheet"></head><body><div id="app"></div><script src="bundle.js"></script></body></html>

deploytest.zip

52.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)