Skip to content

Commit

Permalink
Fix up paths and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Jul 15, 2024
1 parent 5a61f71 commit 2603d7b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ const createContainer = async (project, domain) => {
}

if (this._app.config.driver.options?.storage?.enabled || this._app.config.driver.options?.storage?.path) {
const localPath = path.join('/opt/persistent-storage', project.id)
mkdirSync(localPath)
chownSync(localPath, 1000, 1000)
try {
const localPath = path.join('/opt/persistent-storage', project.id)
console.log(`Creating dir in container ${localPath}`)
mkdirSync(localPath)
chownSync(localPath, 1000, 1000)
} catch (err) {
this._app.log.info(`[docker] problem creating persistent storage for ${project.id}`)
}
const projectPath = path.join(this._app.config.driver.options?.storage?.path, project.id)
if (Array.isArray(contOptions.HostConfig?.Binds)) {
contOptions.HostConfig.Binds.push(`${projectPath}:/data/storage`)
Expand Down

0 comments on commit 2603d7b

Please sign in to comment.