Spaces:
Build error
Build error
File size: 1,000 Bytes
98eaa7b 8c30656 3e875e8 698e726 0165dac 60afc57 8c30656 a97696b 5eaa401 8c30656 0165dac 8c30656 60afc57 8c30656 62b7493 98eaa7b 8c30656 d733a09 60d0969 32684b6 8c30656 b1c8cba 8c30656 815ea35 c7b130c d733a09 9bd5591 b1c8cba 0879bd9 9359cce 8c30656 de37a46 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 |
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
ARG 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/' .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 libcap2-bin -y && \
setcap cap_net_bind_service=+ep `readlink -f \`which node\``
RUN chmod +x start.sh
CMD /bin/bash start.sh
|