File size: 1,771 Bytes
98eaa7b
60afc57
3e875e8
 
698e726
0165dac
 
60afc57
b0bdd97
9b706a5
5eaa401
b0bdd97
0165dac
b0bdd97
60afc57
b0bdd97
f6caeb4
d194565
62b7493
b0bdd97
98eaa7b
b0bdd97
b1244c2
fc9e695
b0bdd97
39b0dcd
4462b87
d215840
 
 
 
b0bdd97
4bd6e4f
98eaa7b
60d0969
32684b6
9b706a5
39b0dcd
 
4462b87
 
 
171e289
b1c8cba
b0bdd97
815ea35
9aa7ef2
c7b130c
535e1e4
d5f7422
f437c9b
 
c7b130c
9bd5591
b0bdd97
b1c8cba
 
0879bd9
6a31f20
 
9359cce
b0bdd97
f6caeb4
9359cce
cd4823c
f803e94
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM node:18

# Set default user and working dir
WORKDIR /opt/node_app
RUN chown -R 1000:1000 /opt/node_app
USER 1000

# Set production build
ENV NODE_ENV=production
ENV PORT=5002

# Git Clone draw and room
RUN git clone https://github.com/excalidraw/excalidraw
#RUN git clone https://github.com/excalidraw/excalidraw-room

# Build excalidraw-room
#WORKDIR /opt/node_app/excalidraw-room
#RUN yarn && yarn build

# BUild excalidraw
WORKDIR /opt/node_app/excalidraw
# Use sed to add in local host on port 5002 
#RUN sed -i 's/VITE_APP_WS_SERVER_URL=/VITE_APP_WS_SERVER_URL=http:\/\/localhost:5002/' .env.production

# Install additional options and deps
RUN npm install react react-dom
#react-scripts canvas node 
  
  
  #vite vite-plugin-svgr @vitejs/plugin-react \
  #vite-plugin-ejs vite-plugin-pwa vite-plugin-checker

#RUN npm install workbox-build workbox-window eslint
#RUN yarn add react react-dom @excalidraw/excalidraw workbox-build workbox-window eslint

# Run yarn to install deps
#RUN yarn --ignore-optional --network-timeout 600000 
#RUN yarn 
RUN npm install && npm run build:app && npm run build:version
#--network-timeout 600000 && \
#  yarn install && \
#  yarn build start


# Make port 5001/5002 available outside the container
EXPOSE 5001
EXPOSE 5002

# Start the development server
#CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "3000"]
#CMD ["python3", "app.py"]
#CMD ["nginx", "-g", "daemon off;"]
#CMD ["python3", "-m", "http.server", "3000"]
COPY start.sh .

# switch back to root to execute start commands
USER root

# Switch to root working dir
WORKDIR /opt/node_app/excalidraw

# Install pm2 for excalidraw-room 
#RUN npm install pm2 -g

RUN chmod +x start.sh
CMD ["/bin/bash", "/opt/node_app/excalidraw/start.sh"]