Skip to content

Commit

Permalink
chore(migration): use workspace isntead
Browse files Browse the repository at this point in the history
  • Loading branch information
iNeoO committed Sep 18, 2024
1 parent b98bac6 commit d96ff13
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"packages/frontend-bo",
"packages/frontend-usagers",
"packages/backend",
"packages/shared"
"packages/shared",
"packages/migrations"
]
}
9 changes: 3 additions & 6 deletions packages/migrations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ FROM node:$NODE_VERSION AS build
WORKDIR /app

COPY ./package.json ./yarn.lock ./
RUN yarn --frozen-lockfile

COPY . .

RUN yarn install --production && yarn cache clean
COPY packages/migrations/package.json packages/migrations/
RUN yarn workspace @vao/migrations install --frozen-lockfile

#--- Run stage
FROM node:$NODE_VERSION
Expand All @@ -23,6 +20,6 @@ COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/src /app/src

# Note: Don't use "yarn start" as it doesn't handle linux signals (graceful shutdown for instance)
CMD ["yarn", "knex", "--cwd", "/app/src", "migrate:latest"]
CMD ["yarn", "workspace", "@vao/migrations", "run", "knex", "--cwd", "./src", "migrate:latest"]


2 changes: 1 addition & 1 deletion packages/migrations/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

yarn workspace @vao/migrations install
exec yarn workspace @vao/migrations run knex --cwd ./src migrate:latest
exec yarn workspace @vao/migrations run knex --cwd ./src migrate:latest

0 comments on commit d96ff13

Please sign in to comment.