Spaces:
Build error
Build error
Commit
·
b0bdd97
1
Parent(s):
f6caeb4
Update Dockerfile
Browse files- Dockerfile +13 -28
Dockerfile
CHANGED
|
@@ -6,41 +6,32 @@ RUN chown -R 1000:1000 /opt/node_app
|
|
| 6 |
USER 1000
|
| 7 |
|
| 8 |
# Set production build
|
| 9 |
-
|
| 10 |
#ENV PORT=5002
|
| 11 |
|
| 12 |
-
# Git Clone
|
| 13 |
RUN git clone https://github.com/excalidraw/excalidraw
|
| 14 |
-
RUN git clone https://github.com/excalidraw/excalidraw-room
|
| 15 |
|
| 16 |
-
#
|
| 17 |
#WORKDIR /opt/node_app/excalidraw-room
|
| 18 |
#RUN yarn && yarn build
|
| 19 |
|
|
|
|
| 20 |
WORKDIR /opt/node_app/excalidraw
|
| 21 |
-
#
|
| 22 |
#RUN sed -i 's/VITE_APP_WS_SERVER_URL=/VITE_APP_WS_SERVER_URL=http:\/\/localhost:5002/' .env.production
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
| 26 |
#RUN npm install workbox-build workbox-window eslint
|
| 27 |
#RUN yarn add react react-dom @excalidraw/excalidraw workbox-build workbox-window eslint
|
| 28 |
|
| 29 |
# Run yarn to install deps
|
| 30 |
RUN yarn --ignore-optional --network-timeout 600000
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
#RUN yarn build:app:docker && \
|
| 34 |
-
# cp -R build/* /var/www/html
|
| 35 |
-
#WORKDIR /opt/node_app/excalidraw/build
|
| 36 |
-
#COPY . /var/www/html/
|
| 37 |
-
|
| 38 |
-
#RUN mkdir -p /opt/node_app/excalidraw/build
|
| 39 |
-
#RUN echo "index.html" > /opt/node_app/excalidraw/build/index.html
|
| 40 |
-
#WORKDIR /opt/node_app/
|
| 41 |
-
#WORKDIR /var/www/html/
|
| 42 |
-
|
| 43 |
-
# Make port 3000 available outside the container
|
| 44 |
EXPOSE 5001
|
| 45 |
EXPOSE 5002
|
| 46 |
|
|
@@ -50,18 +41,12 @@ EXPOSE 5002
|
|
| 50 |
#CMD ["nginx", "-g", "daemon off;"]
|
| 51 |
#CMD ["python3", "-m", "http.server", "3000"]
|
| 52 |
COPY start.sh .
|
|
|
|
| 53 |
# switch back to root to execute start commands
|
| 54 |
USER root
|
| 55 |
|
| 56 |
-
|
| 57 |
-
# Let Node access port 80
|
| 58 |
-
#RUN apt update && \
|
| 59 |
-
# apt install libcap2-bin -y && \
|
| 60 |
-
# setcap cap_net_bind_service=+ep `readlink -f \`which node\``
|
| 61 |
-
|
| 62 |
#RUN npm install pm2 -g
|
| 63 |
|
| 64 |
RUN chmod +x start.sh
|
| 65 |
-
CMD /bin/bash start.sh
|
| 66 |
-
#HEALTHCHECK CMD wget -q -O /dev/null http://localhost:5001 || exit 1
|
| 67 |
-
#CMD ["yarn", "start:production"]
|
|
|
|
| 6 |
USER 1000
|
| 7 |
|
| 8 |
# Set production build
|
| 9 |
+
ENV NODE_ENV=production
|
| 10 |
#ENV PORT=5002
|
| 11 |
|
| 12 |
+
# Git Clone draw and room
|
| 13 |
RUN git clone https://github.com/excalidraw/excalidraw
|
| 14 |
+
#RUN git clone https://github.com/excalidraw/excalidraw-room
|
| 15 |
|
| 16 |
+
# Build excalidraw-room
|
| 17 |
#WORKDIR /opt/node_app/excalidraw-room
|
| 18 |
#RUN yarn && yarn build
|
| 19 |
|
| 20 |
+
# BUild excalidraw
|
| 21 |
WORKDIR /opt/node_app/excalidraw
|
| 22 |
+
# Use sed to add in local host on port 5002
|
| 23 |
#RUN sed -i 's/VITE_APP_WS_SERVER_URL=/VITE_APP_WS_SERVER_URL=http:\/\/localhost:5002/' .env.production
|
| 24 |
|
| 25 |
+
# Install additional options and deps
|
| 26 |
+
RUN yarn add react react-dom
|
| 27 |
+
|
| 28 |
#RUN npm install workbox-build workbox-window eslint
|
| 29 |
#RUN yarn add react react-dom @excalidraw/excalidraw workbox-build workbox-window eslint
|
| 30 |
|
| 31 |
# Run yarn to install deps
|
| 32 |
RUN yarn --ignore-optional --network-timeout 600000
|
| 33 |
|
| 34 |
+
# Make port 5001/5002 available outside the container
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
EXPOSE 5001
|
| 36 |
EXPOSE 5002
|
| 37 |
|
|
|
|
| 41 |
#CMD ["nginx", "-g", "daemon off;"]
|
| 42 |
#CMD ["python3", "-m", "http.server", "3000"]
|
| 43 |
COPY start.sh .
|
| 44 |
+
|
| 45 |
# switch back to root to execute start commands
|
| 46 |
USER root
|
| 47 |
|
| 48 |
+
# Install pm2 for excalidraw-room
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
#RUN npm install pm2 -g
|
| 50 |
|
| 51 |
RUN chmod +x start.sh
|
| 52 |
+
CMD /bin/bash start.sh
|
|
|
|
|
|