mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-04 02:02:48 +03:00
Fix not found npm dev container node_modules, new entrypoint
This commit is contained in:
parent
dfb399c55f
commit
5de922d8ee
@ -5,13 +5,15 @@ RUN mkdir -p /usr/src/frontend
|
||||
# specifying the working dir inside the container
|
||||
WORKDIR /usr/src/frontend
|
||||
|
||||
# copy current dir's content to container's WORKDIR root i.e. all the contents of the robosats app
|
||||
# copy current workdir
|
||||
COPY package.json package.json
|
||||
COPY package-lock.json package-lock.json
|
||||
COPY entrypoint.sh entrypoint.sh
|
||||
RUN chmod +x entrypoint.sh
|
||||
|
||||
# packages we use
|
||||
# install packages
|
||||
RUN npm install
|
||||
RUN mv node_modules /tmp/node_modules
|
||||
|
||||
# launch
|
||||
|
||||
ENTRYPOINT [ "/usr/src/frontend/entrypoint.sh" ]
|
||||
CMD ["npm", "run", "build"]
|
9
frontend/entrypoint.sh
Executable file
9
frontend/entrypoint.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copy node_modules if it doesn't exist
|
||||
if [ ! -f "/usr/src/frontend/node_modules" ]; then
|
||||
echo "Looks like the first run of this container. Node modules were not detected on the attached volume, copying them into the attached volume."
|
||||
cp -R /tmp/node_modules /usr/src/frontend/node_modules
|
||||
fi
|
||||
|
||||
exec "$@"
|
Loading…
Reference in New Issue
Block a user