Skip to content

Commit

Permalink
do more in script, less in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
garethbowen committed Jul 31, 2024
1 parent edbab12 commit 898f2b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 0 additions & 3 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ RUN apk add --update --no-cache \

WORKDIR /service

# I don't think I need to copy the shared-libs but need to double check...
COPY shared-libs ./shared-libs
COPY node_modules/@medic ./node_modules/@medic
COPY api ./api

ENV NODE_PATH=/service/api/node_modules
Expand Down
11 changes: 8 additions & 3 deletions scripts/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@ const buildServiceImages = async () => {
await exec('cp', ['-r', './node_modules', './package.json', './package-lock.json', workingDir]);
console.log('packing modules');
await exec('npm', ['pack'], { cwd: workingDir });
console.log('extracting modules');
// TODO grab the correct version
await exec('tar', ['-Pxzf', `${workingDir}/medic-4.10.0.tgz`]);

console.log('working directory', workingDir);
for (const service of versions.SERVICES) {
console.log('extracting modules');
// TODO grab the correct version
await exec('tar', ['-Pxvzf', `${workingDir}/medic-4.10.0.tgz`, '-C', './' + service]);
await exec('cp', ['-r', `${workingDir}/node_modules`, service]);
await exec('cp', ['-r', './shared-libs', service]);

const tag = versions.getImageTag(service);
if (INTERNAL_CONTRIBUTOR) {
await buildMultiPlatformServiceImage(service, tag);
Expand Down
2 changes: 0 additions & 2 deletions sentinel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ RUN apk add --update --no-cache \

WORKDIR /service

COPY shared-libs ./shared-libs
COPY node_modules/@medic ./node_modules/@medic
COPY sentinel ./sentinel

ENV NODE_PATH=/service/sentinel/node_modules
Expand Down

0 comments on commit 898f2b4

Please sign in to comment.