mirror of
https://github.com/louislam/dockge.git
synced 2024-12-04 15:54:03 +00:00
chown stacks to this user
This commit is contained in:
parent
afe0bc561f
commit
9f6a3eea32
2 changed files with 10 additions and 0 deletions
|
@ -92,6 +92,9 @@ services:
|
||||||
environment:
|
environment:
|
||||||
# Tell Dockge where is your stacks directory
|
# Tell Dockge where is your stacks directory
|
||||||
- DOCKGE_STACKS_DIR=/opt/stacks
|
- DOCKGE_STACKS_DIR=/opt/stacks
|
||||||
|
# Both PUID and PGID must be set for it to do anything
|
||||||
|
- PUID=1000 # Set the stack file/dir ownership to this user
|
||||||
|
- PGID=1000 # Set the stack file/dir ownership to this group
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to Update
|
## How to Update
|
||||||
|
|
|
@ -147,6 +147,13 @@ export class Stack {
|
||||||
|
|
||||||
// Write or overwrite the compose.yaml
|
// Write or overwrite the compose.yaml
|
||||||
fs.writeFileSync(path.join(dir, this._composeFileName), this.composeYAML);
|
fs.writeFileSync(path.join(dir, this._composeFileName), this.composeYAML);
|
||||||
|
if(process.env.PUID && process.env.PGID)
|
||||||
|
{
|
||||||
|
var uid: number = Number(process.env.PUID);
|
||||||
|
var gid: number = Number(process.env.PGID);
|
||||||
|
fs.lchownSync(dir, uid, gid);
|
||||||
|
fs.chownSync(path.join(dir, this._composeFileName), uid, gid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async deploy(socket? : DockgeSocket) : Promise<number> {
|
async deploy(socket? : DockgeSocket) : Promise<number> {
|
||||||
|
|
Loading…
Reference in a new issue