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"]