FROM node:18 # Set default user and working dir #RUN useradd -m -u 1000 user WORKDIR /opt/node_app RUN chown -R 1000:1000 /opt/node_app USER 1000 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/my-excalidraw-app WORKDIR /opt/node_app/excalidraw # Set ENV on dev / prod #RUN echo -e "\n\nBROWSER=NONE" >> .env.development #RUN echo -e "\n\nBROWSER=NONE" >> .env.development # 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 RUN yarn --ignore-optional --network-timeout 600000 && \ chmod 777 -R /opt/node_app/ # Set prod build ARG NODE_ENV=production # Build prod #RUN yarn build:app:docker && \ # cp -R build/* /var/www/html #WORKDIR /opt/node_app/excalidraw/build #COPY . /var/www/html/ #COPY /opt/node_app/excalidraw/build /var/www/html #COPY /opt/node_app/excalidraw/build /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/ # Copy fastapi app #COPY app.py . #COPY nginx.conf /etc/nginx/sites-available/default #RUN ls -a /var/www/html/ #RUN cat /var/www/html/index.html # Make port 3000 available outside the container EXPOSE 5001 # 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 . RUN chmod +x start.sh #RUN yarn build CMD /bin/bash start.sh #HEALTHCHECK CMD wget -q -O /dev/null http://localhost:5001 || exit 1 #CMD ["yarn", "start:production"]