testdocker / Dockerfile
Mediocreatmybest's picture
Update Dockerfile
7b40659
raw
history blame
No virus
1.87 kB
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
#ENV 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:5002/' .env.production
# 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 --ignore-optional --network-timeout 600000
# Build docker version
#RUN yarn build:app:docker && \
# cp -R build/* /var/www/html
#WORKDIR /opt/node_app/excalidraw/build
#COPY . /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/
# Make port 3000 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
# Let Node access port 80
#RUN apt update && \
# apt install libcap2-bin -y && \
# setcap cap_net_bind_service=+ep `readlink -f \`which node\``
RUN npm install pm2 -g
RUN chmod +x start.sh
CMD /bin/bash start.sh
#HEALTHCHECK CMD wget -q -O /dev/null http://localhost:5001 || exit 1
#CMD ["yarn", "start:production"]