Skip to content

Commit

Permalink
Fix docker mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Sep 2, 2024
1 parent 17e70cf commit b6cc832
Showing 1 changed file with 10 additions and 38 deletions.
48 changes: 10 additions & 38 deletions src/containers/action/ActionRunnerContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,12 @@ export class ActionRunnerContainer extends Container {
result = await docker.run(process.env.ACTION_IMAGE, [`/steps/step_${step.uses}`], writable, {
HostConfig: {
Binds: [ // Unlike Mounts those are created if not existing in the host
`${process.env.VOLUME_PREVIEW}/${driveId}/${themeId}:/site/public:rw`
`${process.env.VOLUME_PREVIEW}/${driveId}/${themeId}:/site/public:rw`,
`${process.env.VOLUME_DATA}/${driveId}_transform:/repo:ro`,
`${process.env.VOLUME_DATA}${contentDir}:/site/content:ro`,
`${process.env.VOLUME_DATA}/${driveId}/tmp_dir:/site/tmp_dir:rw`,
],
Mounts: [
{
Source: `${process.env.VOLUME_DATA}/${driveId}_transform`,
Target: '/repo',
Type: 'bind'
},
{
Source: `${process.env.VOLUME_DATA}${contentDir}`,
Target: '/site/content',
Type: 'bind'
},
{
Source: `${process.env.VOLUME_DATA}/${driveId}/tmp_dir`,
Target: '/site/tmp_dir',
Type: 'bind'
},
{
Source: '',
Target: '/site/resources',
Expand Down Expand Up @@ -232,7 +220,7 @@ export class ActionRunnerContainer extends Container {
-v "${process.env.VOLUME_DATA}/${driveId}_transform:/repo" \\
-v "${process.env.VOLUME_DATA}/${driveIdTransform}:/site" \\
-v "${process.env.VOLUME_DATA}${contentDir}:/site/content" \\
-v "${process.env.VOLUME_PREVIEW}/${driveId}:/site/public" \\
-v "${process.env.VOLUME_PREVIEW}/${driveId}/_manual:/site/public" \\
-v "${process.env.VOLUME_DATA}/${driveId}/tmp_dir:/site/tmp_dir" \\
--mount "type=tmpfs,destination=/site/resources" \\
${Object.keys(env).map(key => `--env ${key}="${env[key]}"`).join(' ')} \\
Expand All @@ -242,29 +230,13 @@ export class ActionRunnerContainer extends Container {
result = await docker.run(process.env.ACTION_IMAGE, [`/steps/step_${step.uses}`], writable, {
HostConfig: {
Binds: [ // Unlike Mounts those are created if not existing in the host
`${process.env.VOLUME_PREVIEW}/${driveId}/${themeId}:/site/public:rw`
`${process.env.VOLUME_PREVIEW}/${driveId}/_manual:/site/public:rw`,
`${process.env.VOLUME_DATA}/${driveId}_transform:/repo:ro`,
`${process.env.VOLUME_DATA}/${driveIdTransform}:/site:rw`,
`${process.env.VOLUME_DATA}${contentDir}:/site/content:rw`,
`${process.env.VOLUME_DATA}/${driveId}/tmp_dir:/site/tmp_dir:rw`,
],
Mounts: [
{
Source: `${process.env.VOLUME_DATA}/${driveId}_transform`,
Target: '/repo',
Type: 'bind'
},
{
Source: `${process.env.VOLUME_DATA}/${driveIdTransform}`,
Target: '/site',
Type: 'bind',
},
{
Source: `${process.env.VOLUME_DATA}${contentDir}`,
Target: '/site/content',
Type: 'bind'
},
{
Source: `${process.env.VOLUME_DATA}/${driveId}/tmp_dir`,
Target: '/site/tmp_dir',
Type: 'bind'
},
{
Source: '',
Target: '/site/resources',
Expand Down

0 comments on commit b6cc832

Please sign in to comment.