Skip to content

Commit

Permalink
sync package-lock.json; build docker for multiple architectures
Browse files Browse the repository at this point in the history
We have folks on Apple M1 (arm64) computers who need to run canvas RCE API.

Also changing from "npm install" to "npm ci" to speed up builds and strictly respect the package-lock.json.
The package-lock.json was out of sync with package.json. This commit fixes that too.

refs QUIZ-10725

Test Plan:
* replace your docker-compose.override.yml with this:

  version: '3'
  services:
    web:
      image: starlord.inscloudgate.net/jenkins/canvas-rce-api:53.311253.11
      volumes:
        - .:/usr/src/app
      command:
        - npm
        - run
        - start:dev

* this works on both Apple M1 and Apple Intel:

  docker-compose up

Change-Id: Ieabc515ae2b9e7c07a89d2470f55115d507e2372
Reviewed-on: https://gerrit.instructure.com/c/canvas-rce-api/+/311253
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Yona Appletree <[email protected]>
QA-Review: Yona Appletree <[email protected]>
Product-Review: Jacob DeWar <[email protected]>
  • Loading branch information
mycargus committed Feb 16, 2023
1 parent 92596ca commit b4a0584
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 74 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM instructure/node-passenger:16
FROM --platform=${TARGETPLATFORM:-"linux/amd64"} instructure/node-passenger:16
COPY --chown=docker:docker . /usr/src/app

RUN npm install
RUN npm ci
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ pipeline {
stage('Push latest to Starlord') {
when { environment name: "GERRIT_EVENT_TYPE", value: "change-merged" }
steps {
sh 'docker build --tag starlord.inscloudgate.net/jenkins/canvas-rce-api:latest .'
sh 'docker push starlord.inscloudgate.net/jenkins/canvas-rce-api:latest'
sh 'docker buildx build --builder multi-platform-builder --pull --push --platform=linux/amd64,linux/arm64 --tag "starlord.inscloudgate.net/jenkins/canvas-rce-api:latest" --tag "starlord.inscloudgate.net/jenkins/canvas-rce-api:master" .'
}
}
}
Expand Down
Loading

0 comments on commit b4a0584

Please sign in to comment.