Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Aug 16, 2024
1 parent 7e9c5e0 commit 28e3fd6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 2 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ ENV NODE_ENV=production

WORKDIR /src

COPY --link package.json package-lock.json .
COPY . .
RUN npm install --production=false

COPY --link . .

# Generate the prisma client code
RUN npx prisma generate

Expand All @@ -19,4 +17,4 @@ RUN npm run build
ENV PORT=$PORT

# migrate the db before running the server
CMD npx prisma migrate deploy;node .output/server/index.mjs
CMD ["/bin/bash", "-c", "npx prisma migrate deploy;node .output/server/index.mjs"]
4 changes: 3 additions & 1 deletion docker/run
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ HERE=$(dirname $0)
. $HERE/common

# NB SHA image must be built before running this script
docker run --rm -d \
# run-dependencies should also have been run, to create network and db container (the web app container will apply
# migrations to the db, so the db container must be running first).
docker run -d \
--name "$APP_IMAGE_NAME" \
--network=daedalus \
-p 3000:3000 \
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,12 @@
"1": "==============================",
"2": "Vue version is overridden because of the issue described in the 'tip' in",
"3": "the installation section of https://pinia.vuejs.org/ssr/nuxt.html"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*": "eslint --fix",
"*/schema.prisma": "prisma format"
}
}
9 changes: 4 additions & 5 deletions scripts/run-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ fi

docker exec daedalus-web-app-db wait-for-db

docker network create daedalus
docker network connect daedalus daedalus-web-app-db

# Pull and run the R API image
R_API_IMAGE='mrcide/daedalus.api:latest'
docker pull $R_API_IMAGE # There will be a 'latest' tag: https://github.com/jameel-institute/daedalus.api/pull/2#issuecomment-2252491603
docker run -d --name daedalus-api --rm -p 8001:8001 $R_API_IMAGE

docker network create daedalus
docker network connect daedalus daedalus-api
docker network connect daedalus daedalus-web-app-db
docker run -d --name daedalus-api --rm --network=daedalus -p 8001:8001 $R_API_IMAGE

0 comments on commit 28e3fd6

Please sign in to comment.