File size: 1,866 Bytes
98eaa7b
60afc57
3e875e8
 
698e726
0165dac
 
60afc57
 
b2111e2
5eaa401
60afc57
0165dac
 
60afc57
535e1e4
62b7493
 
 
98eaa7b
60afc57
b1244c2
fc9e695
46a59bb
4bd6e4f
 
98eaa7b
60d0969
32684b6
b1c8cba
 
ad82248
c7b130c
 
f437c9b
 
6a32a1e
6fa7eef
 
f437c9b
c7b130c
235f4a0
535e1e4
815ea35
9aa7ef2
c7b130c
535e1e4
d5f7422
f437c9b
 
c7b130c
9bd5591
b1c8cba
 
9359cce
 
 
b2111e2
 
 
 
 
9359cce
cd4823c
79cb178
cd4823c
d22beb3
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
67
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
ARG NODE_ENV=production
ENV PORT=5002

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

# Change to the newly created directory
WORKDIR /opt/node_app/excalidraw-room
RUN yarn && yarn build

WORKDIR /opt/node_app/excalidraw
# Set app server to localhost
#RUN sed -i 's/VITE_APP_WS_SERVER_URL=/VITE_APP_WS_SERVER_URL=http:\/\/localhost:5002/' .env.production

# Setup npm / yarn / deps
#RUN npm install react react-dom
#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 

# Build docker version
#RUN yarn build:app:docker && \
#  cp -R build/* /var/www/html
#WORKDIR /opt/node_app/excalidraw/build
#COPY . /var/www/html/

#RUN mkdir -p /opt/node_app/excalidraw/build
#RUN echo "index.html" > /opt/node_app/excalidraw/build/index.html
#WORKDIR /opt/node_app/
#WORKDIR /var/www/html/

# Make port 3000 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


# Let Node access port 80
#RUN apt update && \
#  apt install libcap2-bin -y && \
#  setcap cap_net_bind_service=+ep `readlink -f \`which node\``

RUN npm install pm2 -g

RUN chmod +x start.sh
CMD /bin/bash start.sh
#HEALTHCHECK CMD wget -q -O /dev/null http://localhost:5001 || exit 1
#CMD ["yarn", "start:production"]