FROM node:18 # Default working dir WORKDIR /opt/node_app # Get apt up and running RUN apt update RUN apt install python3-pip python3-uvicorn python3-fastapi -y #RUN apt install git yarn -y #RUN npm install --global yarn RUN apt install nginx -y #RUN npm install react react-dom @excalidraw/excalidraw vscode-languageclient -g # Create a React #RUN npx create-react-app my-excalidraw-app RUN git clone https://github.com/excalidraw/excalidraw # 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 # Set prod build ARG NODE_ENV=production # Build prod RUN yarn build:app:docker RUN ls -a COPY /opt/node_app/excalidraw/build /var/www/html #COPY /opt/node_app/excalidraw/build /var/www/html #RUN echo "index.html" > /var/www/html/index.html WORKDIR /opt/node_app/ # Copy fastapi app #COPY app.py . #COPY nginx.conf /etc/nginx/sites-available/default # Make port 3000 available outside the container EXPOSE 3000 # 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;"]