File size: 1,043 Bytes
98eaa7b
8c30656
3ee5b6d
 
 
3e875e8
 
698e726
0165dac
 
60afc57
8c30656
5eaa401
8c30656
0165dac
8c30656
60afc57
8c30656
 
 
62b7493
98eaa7b
8c30656
0d99e1a
60d0969
32684b6
8c30656
 
b1c8cba
8c30656
815ea35
c7b130c
d733a09
9bd5591
b1c8cba
 
0879bd9
9359cce
8c30656
 
8320316
8c30656
9359cce
cd4823c
8c30656
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
FROM node:18

# Install global 
RUN npm install pm2 -g

# 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

# 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

# Run yarn to install deps
RUN yarn --ignore-optional --network-timeout 600000 


# Make port 3000 available outside the container
EXPOSE 5001

# Copy start file
COPY start.sh .
# switch back to root to execute start commands
USER root


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

RUN chmod +x start.sh
CMD /bin/bash start.sh