Skip to content

Commit

Permalink
Internal/run container in production mode (#456)
Browse files Browse the repository at this point in the history
* Added NODE_ENV=production because the container is trying to run in development mode

* Use Vanilla dspace-ui.json instead of ours from root.

* Updated path for running `dspace-ui.json`
  • Loading branch information
milanmajchrak authored Feb 1, 2024
1 parent 431ea2b commit 97b25bb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 26 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/build-scripts/run/
pwd
touch .env.dev-5 || true
echo INSTANCE=5 >> .env.dev-5
echo DSPACE_HOST=dev-5.pc >> .env.dev-5
Expand All @@ -50,7 +50,7 @@ jobs:
echo DSPACE_UI_IMAGE=\${DOCKER_OWNER}/dspace-angular:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_IMAGE=\${DOCKER_OWNER}/dspace:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_PORT=8\$INSTANCE >> .env.dev-5
echo REST_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT}/server/ >> .env.dev-5
echo REST_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT}/server >> .env.dev-5
echo UI_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT} >> .env.dev-5
echo S3_STORAGE=0 >> .env.dev-5
Expand All @@ -62,6 +62,8 @@ jobs:
echo S3_SECRET=${{ secrets.AMAZON_SECRET }} >> .env.dev-5
echo S3_REGION_NAME=eu-central-1 >> .env.dev-5
echo NODE_ENV=production >> .env.dev-5
export ENVFILE=$(pwd)/.env.dev-5
./start.sh dspace-5
Expand All @@ -86,8 +88,8 @@ jobs:
./start.sh dspace-$INSTANCE
/bin/bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://dev-5.pc:8$INSTANCE/server/api)" != "200" ]]; do sleep 5; done'
import-8:
runs-on: dspace-dep-1
if: github.event.inputs.IMPORT == 'true'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ ENV NODE_ENV development
RUN apk add tzdata
RUN yarn build:prod
RUN npm install pm2 -g
CMD /bin/sh -c "pm2-runtime start dspace-ui.json > /dev/null 2> /dev/null"
CMD /bin/sh -c "pm2-runtime start docker/dspace-ui.json > /dev/null 2> /dev/null"

2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
dockerfile: Dockerfile
networks:
dspacenet:
entrypoint: ${FE_CMD:-/bin/sh -c "pm2-runtime start dspace-ui.json > /dev/null 2> /dev/null"}
entrypoint: ${FE_CMD:-/bin/sh -c "pm2-runtime start docker/dspace-ui.json > /dev/null 2> /dev/null"}
ports:
- published: 400${INSTANCE}
target: 4000
Expand Down
17 changes: 9 additions & 8 deletions docker/dspace-ui.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"apps": [
{
"name": "dspace-ui",
"cwd": "/app",
"script": "dist/server/main.js",
"instances": "max",
"exec_mode": "cluster"
}
{
"name": "dspace-ui",
"cwd": "/app",
"script": "dist/server/main.js",
"instances": "7",
"exec_mode": "cluster",
"node_args": "--max_old_space_size=4096"
}
]
}
}
12 changes: 0 additions & 12 deletions dspace-ui.json

This file was deleted.

0 comments on commit 97b25bb

Please sign in to comment.