Skip to content

Commit

Permalink
chore: better approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Amninder Kaur committed Jan 12, 2024
1 parent 4353696 commit fa4b026
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bin/ghcr-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
set -e
package_name=$1
version=$2

docker_file=$package_name/Dockerfile
echo $(pwd)
cd $package_name
tag_with_version=pit-$package_name:$version
tag_ref=ghcr.io/kindredgroup/pit-toolkit/$tag_with_version
echo $tag_ref
docker build -f $docker_file . --tag $tag_ref
docker build . --tag $tag_ref
#for ghcr.io access token mentioned in the github secrets and accessed in actions
docker push $tag_ref
8 changes: 4 additions & 4 deletions lock-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ FROM node:18.18.2-alpine3.18 AS baseimage
FROM baseimage AS BUILD

WORKDIR /opt/build
COPY ${pwd}/lock-manager/package.json ${pwd}/lock-manager/package-lock.json ${pwd}/lock-manager/tsconfig.json ./
COPY package.json package-lock.json tsconfig.json ./
RUN npm ci

COPY ${pwd}/lock-manager/src/ ./src
COPY src/ ./src

RUN npm run build

Expand All @@ -16,10 +16,10 @@ FROM baseimage AS RUN

WORKDIR /opt/build

COPY ${pwd}/lock-manager/package.json ${pwd}/lock-manager/package-lock.json ./
COPY package.json package-lock.json ./
COPY --from=BUILD /opt/build/node_modules/ ./node_modules
COPY --from=BUILD /opt/build/dist/ ./dist
COPY ${pwd}/lock-manager/migrations/ ./migrations
COPY migrations/ ./migrations

CMD ["npm", "run", "migrate_and_start"]

0 comments on commit fa4b026

Please sign in to comment.