Skip to content

Commit c3190c7

Browse files
committed
changed gitignor
1 parent c3b2d5c commit c3190c7

File tree

12 files changed

+1080
-5
lines changed

12 files changed

+1080
-5
lines changed

.Dockerfile-1stage

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

.Dockerfile-nginx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: Node Server
19+
FROM node:19-alpine as node_server
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+
31+
EXPOSE 5656
32+
33+
ENV IS_DOCKER true
34+
35+
CMD [ "npm", "start" ]
36+
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;"]

.docker-compose-nginx.yml

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

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ build/Release
8383
# Dependency directories
8484
node_modules/
8585
jspm_packages/
86-
# dist/
86+
dist/
8787
build/
8888
release-builds/
8989

90-
.docker-compose-nginx.yml
91-
.Dockerfile-1stage
92-
.Dockerfile-nginx
93-
.electron
90+
# .docker-compose-nginx.yml
91+
# .Dockerfile-1stage
92+
# .Dockerfile-nginx
93+
# .electron
9494

9595
# TypeScript v1 declaration files
9696
typings/

0 commit comments

Comments
 (0)