diff options
author | Sunil Shetye | 2024-03-22 22:00:00 +0530 |
---|---|---|
committer | Sunil Shetye | 2024-03-22 22:00:00 +0530 |
commit | 9b74cd92fdbbfeeddec2307842ffbd3712a681e3 (patch) | |
tree | a06ad14fa99e0bacaeaf0c9a31100fbd45af2a81 | |
parent | 2d6bdaf916c34eeaabc3b1c46048c61cc98d3aee (diff) | |
download | Common-Interface-Project-9b74cd92fdbbfeeddec2307842ffbd3712a681e3.tar.gz Common-Interface-Project-9b74cd92fdbbfeeddec2307842ffbd3712a681e3.tar.bz2 Common-Interface-Project-9b74cd92fdbbfeeddec2307842ffbd3712a681e3.zip |
add dockerfile for prod
-rw-r--r-- | blocks/Dockerfile.patch | 17 | ||||
-rwxr-xr-x | blocks/install.sh | 7 | ||||
-rwxr-xr-x | blocks/run.sh | 6 |
3 files changed, 29 insertions, 1 deletions
diff --git a/blocks/Dockerfile.patch b/blocks/Dockerfile.patch new file mode 100644 index 00000000..b933c455 --- /dev/null +++ b/blocks/Dockerfile.patch @@ -0,0 +1,17 @@ +--- blocks/Dockerfile 2024-03-22 13:29:04.368574427 +0530 ++++ blocks/Dockerfile.1 2024-03-22 20:47:14.630043479 +0530 +@@ -121,7 +121,7 @@ + COPY . . + + # Configure venv and sqlite3 +-RUN ./install.sh ++RUN ./install.sh prod + + # Cleanup + RUN apt-get autoremove -qq --purge gawk python3-pip python3-venv wget xz-utils +@@ -172,4 +172,4 @@ + + WORKDIR ${XCOS_DIR} + +-CMD ["./run.sh"] ++CMD ["./run.sh", "prod"] diff --git a/blocks/install.sh b/blocks/install.sh index 48461638..c2937ee9 100755 --- a/blocks/install.sh +++ b/blocks/install.sh @@ -3,7 +3,14 @@ set -e cd eda-frontend +if test "$1" = 'prod'; then + npm install -g serve +fi npm install --silent +if test "$1" = 'prod'; then + npm run build + rm -rf node_modules public src +fi echo 'WDS_SOCKET_PORT=8000' > .env.local cd .. diff --git a/blocks/run.sh b/blocks/run.sh index 20788d8f..02e6e55c 100755 --- a/blocks/run.sh +++ b/blocks/run.sh @@ -9,7 +9,11 @@ service redis-server start celery -A blocks.celery_tasks worker --loglevel INFO --concurrency 1 & cd eda-frontend -npm start & +if test "$1" = 'prod'; then + serve -l 3500 -n -s --no-port-switching build & +else + npm start & +fi cd .. python manage.py runserver |