Skip to content

Commit

Permalink
command changes
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Dec 22, 2023
1 parent fd2f170 commit 308af12
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dockerManager/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SITE_NAME=${SITE_NAME:-"CyberPanel Site"}

### Install LSCache plugin

/usr/local/lsws/lsphp82/bin/php /usr/bin/wp plugin install litespeed-cache --allow-root --path="/usr/local/lsws/Example/html"
/usr/local/lsws/lsphp82/bin/php /usr/bin/wp plugin install litespeed-cache --allow-root --path="/usr/local/lsws/Example/html" --activate

# Start OpenLiteSpeed
/usr/local/lsws/bin/lswsctrl start
Expand Down
19 changes: 14 additions & 5 deletions plogical/DockerSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ def DeployWPContainer(self):
### WriteConfig to compose-file

command = f"mkdir -p /home/docker/{self.data['finalURL']}"
ProcessUtilities.executioner(command)
result, message = ProcessUtilities.outputExecutioner(command)

if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
return 0

TempCompose = f'/home/cyberpanel/{self.data["finalURL"]}-docker-compose.yml'

Expand All @@ -300,18 +304,23 @@ def DeployWPContainer(self):
WriteToFile.close()

command = f"mv {TempCompose} {self.data['ComposePath']}"
ProcessUtilities.executioner(command)
result, message = ProcessUtilities.outputExecutioner(command)

if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
return 0

command = f"chmod 600 {self.data['ComposePath']} && chown root:root {self.data['ComposePath']}"
ProcessUtilities.executioner(command, 'root', True)

####

command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d"
result = ProcessUtilities.outputExecutioner(command)
result, message = ProcessUtilities.outputExecutioner(command)

if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result)
if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
return 0

### Set up Proxy

Expand Down

0 comments on commit 308af12

Please sign in to comment.