-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
183 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: PHP 8.1 | ||
|
||
on: | ||
schedule: | ||
- cron: '15 22 * * 2' | ||
workflow_dispatch: | ||
|
||
env: | ||
# The default repo env will be 'ComputeStacks'; uppercase is not allowed. | ||
GH_REPO: computestacks/cs-docker-whmcs | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into Github Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Log into DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: build-and-push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: php8.1/ | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: | | ||
cmptstks/whmcs:php8.1-litespeed | ||
cmptstks/whmcs:latest | ||
ghcr.io/${{ env.GH_REPO }}:php8.1-litespeed | ||
ghcr.io/${{ env.GH_REPO }}:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
wait_for_db() { | ||
counter=0 | ||
echo >&2 "Connecting to database at $DB_HOST" | ||
while ! mysql -h $DB_HOST -P ${DB_PORT:-3306} -u $DB_USER -p$DB_PASSWORD -e "USE mysql;" >/dev/null; do | ||
counter=$((counter+1)) | ||
if [ $counter == 30 ]; then | ||
echo >&2 "Error: Couldn't connect to database." | ||
exit 1 | ||
fi | ||
echo >&2 "Trying to connect to database at $DB_HOST. Attempt $counter..." | ||
sleep 5 | ||
done | ||
} | ||
|
||
setup_db() { | ||
echo >&2 "Creating the database..." | ||
mysql -h $DB_HOST -P ${DB_PORT:-3306} -u $DB_USER -p$DB_PASSWORD --skip-column-names -e "CREATE DATABASE IF NOT EXISTS $DB_NAME;" | ||
} | ||
|
||
if [ ! -d /var/www/html/whmcs ]; then | ||
echo >&2 "No whmcs installation found in volume - copying default files..." | ||
mv /usr/src/whmcs /var/www/html/ | ||
chown -R www-data:www-data /var/www/html/ | ||
echo >&2 "Complete! Sample files have been successfully copied to /var/www/html/whmcs" | ||
|
||
wait_for_db | ||
setup_db | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# docker run --rm -it -e LS_ADMIN_PW=changeme -p 3000:80 -p 7080:7080 cmptstks/whmcs:php7.4-litespeed /sbin/my_init -- bash -l | ||
FROM ghcr.io/computestacks/cs-docker-php:8.1-litespeed | ||
|
||
LABEL maintainer="https://computestacks.com" | ||
LABEL org.opencontainers.image.authors="https://computestacks.com" | ||
LABEL org.opencontainers.image.source="https://github.com/ComputeStacks/cs-docker-whmcs/tree/main/php8.1" | ||
LABEL org.opencontainers.image.url="https://github.com/ComputeStacks/cs-docker-whmcs/tree/main/php8.1" | ||
LABEL org.opencontainers.image.title="WHMCS with OpenLiteSpeed" | ||
|
||
COPY 51-whmcs.sh /etc/my_init.d/ | ||
COPY root/vhosts /usr/src/lsws/conf/vhosts/ | ||
ADD https://f.cscdn.cc/file/cstackscdn/packages/whmcs/whmcs_v861_full.zip /usr/src/whmcs.zip | ||
|
||
RUN set -ex; \ | ||
unzip -d /usr/src/ /usr/src/whmcs.zip \ | ||
&& mv /usr/src/whmcs /usr/src/whmcs-public \ | ||
&& mkdir /usr/src/whmcs \ | ||
&& mv /usr/src/whmcs-public /usr/src/whmcs/ \ | ||
&& echo "#*/5 * * * * www-data /usr/local/lsws/lsphp81/bin/php -q /var/www/html/whmcs/whmcs-public/crons/cron.php" >> /usr/src/default/crontab \ | ||
&& echo "#*/5 * * * * www-data /usr/local/lsws/lsphp81/bin/php -q /var/www/html/whmcs/whmcs-public/crons/cron.php do --TicketEscalations" >> /usr/src/default/crontab \ | ||
&& mkdir /usr/src/whmcs/whmcs-updates \ | ||
&& mkdir /usr/src/whmcs/whmcs-private \ | ||
&& mkdir /usr/src/whmcs/log \ | ||
&& chmod +x /etc/my_init.d/51-whmcs.sh \ | ||
; \ | ||
sed -i 's/ map Default/ map WHMCS/g' /usr/src/lsws/conf/httpd_config.conf; \ | ||
echo '\n\ | ||
virtualhost WHMCS { \n\ | ||
vhRoot /var/www/html/whmcs/whmcs-public \n\ | ||
configFile conf/vhosts/WHMCS/vhconf.conf \n\ | ||
allowSymbolLink 1 \n\ | ||
enableScript 1 \n\ | ||
restrained 1 \n\ | ||
smartKeepAlive 1 \n\ | ||
user 1001 \n\ | ||
group 1001 \n\ | ||
}' >> /usr/src/lsws/conf/httpd_config.conf && chown lsadm: -R /usr/src/lsws/conf/vhosts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
docRoot /var/www/html/whmcs/whmcs-public | ||
enableGzip 1 | ||
|
||
errorlog /var/www/html/whmcs/log/error.log { | ||
useServer 0 | ||
logLevel INFO | ||
rollingSize 10M | ||
keepDays 15 | ||
} | ||
|
||
accesslog /var/www/html/whmcs/log/access.log { | ||
useServer 0 | ||
logFormat %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\ | ||
rollingSize 10M | ||
keepDays 15 | ||
} | ||
|
||
|
||
index { | ||
useServer 0 | ||
indexFiles index.php | ||
} | ||
|
||
context / { | ||
allowBrowse 1 | ||
enableExpires 1 | ||
|
||
rewrite { | ||
|
||
} | ||
addDefaultCharset off | ||
|
||
phpIniOverride { | ||
|
||
} | ||
} | ||
|
||
context /vendor { | ||
allowBrowse 0 | ||
|
||
rewrite { | ||
|
||
} | ||
addDefaultCharset off | ||
|
||
phpIniOverride { | ||
|
||
} | ||
} | ||
|
||
rewrite { | ||
enable 1 | ||
autoLoadHtaccess 1 | ||
} |
This file was deleted.
Oops, something went wrong.