diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 750e5485..c7110d97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,11 +22,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Create .npmrc - run: | - echo '@restatedev:registry=https://npm.pkg.github.com/' > typescript/.npmrc - echo '//npm.pkg.github.com/:_authToken=${GH_PACKAGE_READ_ACCESS_TOKEN}' >> typescript/.npmrc + registry-url: 'https://registry.npmjs.org' - run: npm ci --prefix typescript - env: - GH_PACKAGE_READ_ACCESS_TOKEN: ${{ secrets.GH_PACKAGE_READ_ACCESS_TOKEN }} - run: npm run --prefix typescript -ws verify diff --git a/typescript/ecommerce-store/README.md b/typescript/ecommerce-store/README.md index 8efd911e..4b3bbd99 100644 --- a/typescript/ecommerce-store/README.md +++ b/typescript/ecommerce-store/README.md @@ -24,7 +24,7 @@ Build the Docker containers for the web app and services: ```shell docker build -t dev.local/shopping-cart/react-app:0.0.1 ./react-shopping-cart -docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 --secret id=npmrc,src=$HOME/.npmrc +docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 ``` You can store the products data in the Restate runtime or in a separate Postgres DB: diff --git a/typescript/ecommerce-store/deployment/aws/README.md b/typescript/ecommerce-store/deployment/aws/README.md index 34e79b4d..661a60f3 100644 --- a/typescript/ecommerce-store/deployment/aws/README.md +++ b/typescript/ecommerce-store/deployment/aws/README.md @@ -27,7 +27,7 @@ Build the following Docker images and push them to AWS ECR. At the root of the r ```shell # Shopping services -docker build ./services -t $ECR_REPOSITORY/shopping-cart-demo:1.0.2 --secret id=npmrc,src=$HOME/.npmrc +docker build ./services -t $ECR_REPOSITORY/shopping-cart-demo:1.0.2 docker push $ECR_REPOSITORY/shopping-cart-demo:1.0.2 # Shopping web app docker build -t $ECR_REPOSITORY/shopping-cart-webapp:1.0.2 ./react-shopping-cart diff --git a/typescript/ecommerce-store/deployment/knative/README.md b/typescript/ecommerce-store/deployment/knative/README.md index 21ee4bc4..d97036c4 100644 --- a/typescript/ecommerce-store/deployment/knative/README.md +++ b/typescript/ecommerce-store/deployment/knative/README.md @@ -12,7 +12,7 @@ kn quickstart kind 2. Build the Docker images for the web application and backend services: ```shell docker build -t dev.local/shopping-cart/react-app:0.0.1 ./react-shopping-cart -docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 --secret id=npmrc,src=$HOME/.npmrc +docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 ``` Upload the images to the cluster: diff --git a/typescript/ecommerce-store/services/Dockerfile b/typescript/ecommerce-store/services/Dockerfile index 1d75bec6..3d3417ec 100644 --- a/typescript/ecommerce-store/services/Dockerfile +++ b/typescript/ecommerce-store/services/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /usr/src/app # copy package.json and package-lock.json separately to cache dependencies COPY package*.json . COPY tsconfig.json . -RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm install +RUN npm install COPY --chown=node:node . . RUN npm run proto @@ -19,4 +19,4 @@ ENV NODE_ENV production ENV PORT 8080 EXPOSE 8080 USER node -CMD ["dumb-init", "node", "./dist/app.js"] \ No newline at end of file +CMD ["dumb-init", "node", "./dist/app.js"] diff --git a/typescript/food-ordering/README.md b/typescript/food-ordering/README.md index dfc1b3d6..b3a01be3 100644 --- a/typescript/food-ordering/README.md +++ b/typescript/food-ordering/README.md @@ -60,7 +60,7 @@ Have a look at the implementation of the `prepareOrder` function in the `OrderSe Build the services: ```shell -docker build ./services/ -t dev.local/food-ordering/services:0.0.1 --secret id=npmrc,src=$HOME/.npmrc && \ +docker build ./services/ -t dev.local/food-ordering/services:0.0.1 && \ docker build ./pos_server/ -t dev.local/food-ordering/pos_server:0.0.1 ``` diff --git a/typescript/food-ordering/services/Dockerfile b/typescript/food-ordering/services/Dockerfile index d2a59a83..abdc7840 100644 --- a/typescript/food-ordering/services/Dockerfile +++ b/typescript/food-ordering/services/Dockerfile @@ -7,13 +7,13 @@ WORKDIR /usr/src/app # copy package.json and package-lock.json separately to cache dependencies COPY package*.json . -RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm install +RUN npm install COPY --chown=node:node .. . RUN npm run build -RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm prune --omit=dev +RUN npm prune --omit=dev ENV NODE_ENV production EXPOSE 8080