Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
9c247613
Commit
9c247613
authored
Apr 07, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 2 files via Son of Anton
parent
89dbaf19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
30 deletions
+22
-30
Dockerfile
Dockerfile
+3
-2
entrypoint.sh
docker/entrypoint.sh
+19
-28
No files found.
Dockerfile
View file @
9c247613
...
...
@@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y \
zip
\
unzip
\
default-mysql-client
\
dos2unix
\
&&
rm
-rf
/var/lib/apt/lists/
*
# ── PHP extensions ──
...
...
@@ -65,9 +66,9 @@ ENV SMS_PROVIDER=
ENV
SMS_API_KEY=
ENV
SMS_SENDER_ID=
# ── Entrypoint ──
# ── Entrypoint
— fix line endings then copy
──
COPY
docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN
chmod
+x /usr/local/bin/entrypoint.sh
RUN
dos2unix /usr/local/bin/entrypoint.sh
&&
chmod
+x /usr/local/bin/entrypoint.sh
EXPOSE
80
...
...
docker/entrypoint.sh
View file @
9c247613
...
...
@@ -6,34 +6,32 @@ echo " THE CLUB ERP — Container Starting"
echo
"========================================="
# ── Wait for MySQL to be ready ──
echo
"
⏳
Waiting for MySQL at
${
DB_HOST
}
:
${
DB_PORT
}
..."
echo
"Waiting for MySQL at
${
DB_HOST
}
:
${
DB_PORT
}
..."
MAX_TRIES
=
30
COUNT
=
0
until
mysql
-h
"
${
DB_HOST
}
"
-P
"
${
DB_PORT
}
"
-u
"
${
DB_USER
}
"
-p
"
${
DB_PASS
}
"
-e
"SELECT 1"
&>/dev/null
;
do
COUNT
=
$((
COUNT
+
1
))
if
[
$COUNT
-ge
$MAX_TRIES
]
;
then
echo
"
❌
MySQL not ready after
${
MAX_TRIES
}
attempts. Aborting."
echo
"MySQL not ready after
${
MAX_TRIES
}
attempts. Aborting."
exit
1
fi
echo
" Attempt
${
COUNT
}
/
${
MAX_TRIES
}
..."
sleep
2
done
echo
"
✅
MySQL is ready!"
echo
"MySQL is ready!"
# ── Create database if it doesn't exist ──
echo
"
📦
Ensuring database '
${
DB_NAME
}
' exists..."
echo
"Ensuring database '
${
DB_NAME
}
' exists..."
mysql
-h
"
${
DB_HOST
}
"
-P
"
${
DB_PORT
}
"
-u
"
${
DB_USER
}
"
-p
"
${
DB_PASS
}
"
-e
\
"CREATE DATABASE IF NOT EXISTS
\`
${
DB_NAME
}
\`
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
echo
"
✅
Database ready!"
echo
"Database ready!"
# ── Generate .env from environment variables
if not exists
──
# ── Generate .env from environment variables ──
ENV_FILE
=
"/var/www/html/.env"
if
[
!
-f
"
$ENV_FILE
"
]
;
then
echo
"📝 Generating .env from environment variables..."
cat
>
"
$ENV_FILE
"
<<
EOF
cat
>
"
$ENV_FILE
"
<<
EOF
APP_URL=
${
APP_URL
:-
http
://localhost
}
APP_DEBUG=
${
APP_DEBUG
:-
fals
e
}
APP_ENV=
${
APP_ENV
:-
production
}
APP_DEBUG=
${
APP_DEBUG
:-
tru
e
}
APP_ENV=
${
APP_ENV
:-
local
}
DB_HOST=
${
DB_HOST
:-
localhost
}
DB_PORT=
${
DB_PORT
:-
3306
}
...
...
@@ -45,36 +43,29 @@ SMS_PROVIDER=${SMS_PROVIDER:-}
SMS_API_KEY=
${
SMS_API_KEY
:-}
SMS_SENDER_ID=
${
SMS_SENDER_ID
:-}
EOF
chown
www-data:www-data
"
$ENV_FILE
"
echo
"✅ .env generated!"
else
echo
"✅ .env already exists, skipping generation."
fi
chown
www-data:www-data
"
$ENV_FILE
"
echo
".env generated!"
# ── Run Migrations ──
echo
"========================================="
echo
"
🔄
Running Migrations..."
echo
"Running Migrations..."
echo
"========================================="
cd
/var/www/html
php cli.php migrate 2>&1
||
{
echo
"⚠️ Migration had issues, but continuing..."
}
echo
"✅ Migrations complete!"
php cli.php migrate 2>&1
||
echo
"Migration had issues, continuing..."
echo
"Migrations complete!"
# ── Run Seeds ──
echo
"========================================="
echo
"
🌱
Running Seeds..."
echo
"Running Seeds..."
echo
"========================================="
php cli.php seed 2>&1
||
{
echo
"⚠️ Seeding had issues, but continuing..."
}
echo
"✅ Seeds complete!"
php cli.php seed 2>&1
||
echo
"Seeding had issues, continuing..."
echo
"Seeds complete!"
# ── Fix permissions
after migrations/seeds
──
# ── Fix permissions ──
chown
-R
www-data:www-data /var/www/html/storage 2>/dev/null
||
true
chmod
-R
775 /var/www/html/storage 2>/dev/null
||
true
echo
"========================================="
echo
"
🚀
Starting Apache..."
echo
"Starting Apache..."
echo
"========================================="
exec
apache2-foreground
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment