Skip to content

Commit

Permalink
Merge pull request #925 from factly/fix/docker-cache
Browse files Browse the repository at this point in the history
Update dega-studio build to include latest dependencies
  • Loading branch information
ganga2166 committed May 24, 2024
2 parents 6a82899 + 34af278 commit fa42c3d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ Once the application is up and running you should be able to access it using the

- Create config file with name config (and extension .env, .yml, .json) in `server/`, `api/` and `templates/` add config variables (for eg see config.env.example in each folder)
- Create a `.env` file inside companion folder in root for companion config variables (for eg see .env.example file in companion folder)
git fetch upstream
git fetch upstream
- to add default env files automatically run `bash build.sh`

## Development Notes
- If there are updates to npm dependencies for `dega-studio`, run `bash build-nocache.sh` from the project root.
- If the script fails to update dependencies, enter the container and manually run `npm install --legacy-peer-deps`.

8 changes: 8 additions & 0 deletions build-nocache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# Create a unique cache bust value
CACHEBUST=$(date +%s)

# Pass the cache bust value as a build argument
docker-compose build --no-cache --build-arg CACHEBUST=$CACHEBUST dega-studio
docker-compose up
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ services:
build:
context: ./studio
dockerfile: Dockerfile
no_cache: true
args:
- CACHEBUST
environment:
- PUBLIC_URL=http://127.0.0.1:4455/.factly/dega/studio
- REACT_APP_KAVACH_PUBLIC_URL=http://127.0.0.1:4455/.factly/kavach/web
Expand Down
2 changes: 2 additions & 0 deletions studio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
FROM node:16-alpine

# set working directory
ARG CACHEBUST=100

WORKDIR /app

# install app dependencies
Expand Down

0 comments on commit fa42c3d

Please sign in to comment.