Minor fixes on dev setup start up

This commit is contained in:
Reckless_Satoshi 2023-05-17 02:27:19 -07:00
parent 0a620901a7
commit 2bb0b4d7bf
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 10 additions and 5 deletions

View File

@ -12,12 +12,14 @@ RUN apt-get update && \
# copy current workdir # copy current workdir
COPY package.json package.json COPY package.json package.json
COPY package-lock.json package-lock.json COPY package-lock.json package-lock.json
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
# install packages # install packages
RUN npm install RUN npm install
RUN mv node_modules /tmp/node_modules RUN mv node_modules /tmp/node_modules
# copy entrypoint
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT [ "/usr/src/frontend/entrypoint.sh" ] ENTRYPOINT [ "/usr/src/frontend/entrypoint.sh" ]
CMD ["npm", "run", "build"] CMD ["npm", "run", "build"]

View File

@ -10,11 +10,14 @@ else
python manage.py collectstatic --noinput python manage.py collectstatic --noinput
fi fi
# Copy pb2/grpc files if they do exist # Print first start up message when pb2/grpc files if they do exist
if [ ! -f "/usr/src/robosats/api/lightning/lightning_pb2.py" ]; then if [ ! -f "/usr/src/robosats/api/lightning/lightning_pb2.py" ]; then
echo "Looks like the first run of this container. pb2 and gRPC files were not detected on the attached volume, copying them into the attached volume /robosats/api/node ." echo "Looks like the first run of this container. pb2 and gRPC files were not detected on the attached volume, copying them into the attached volume /robosats/api/lightning ."
cp -R /tmp/* /usr/src/robosats/api/lightning/
fi fi
# Copy and overwrite all existing pb2/grpc files always. Therefore, running
# /scripts/generate_grpc.sh only makes sense if done during Dockerfile build
cp -R /tmp/* /usr/src/robosats/api/lightning/
# Start server / gunicorn / daphne / command # Start server / gunicorn / daphne / command
exec "$@" exec "$@"