Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM orvice/apache-base
MAINTAINER orvice<orvice@orx.me>

ENV SSPANEL_VERSION 4.0.0

RUN apt-get update && apt-get install -y \
netcat \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /var/www/html

# Install sspanel
Expand Down
1 change: 1 addition & 0 deletions app/Controllers/MuV2/NodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function users($request, $response, $args)
{
$users = User::all();
$res = [
'ret' => 1,
'msg' => 'ok',
'data' => $users,
];
Expand Down
14 changes: 14 additions & 0 deletions app/Services/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Services;

use App\Services\Config\DbConfig;

class Config
{
public static function get($key)
{
$dc = new DbConfig();
return $dc->get($key);
}
}
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@ services:
redis:
restart: always
image: redis:latest
ports:
- 6379:6379
container_name: sspanel_redis
command:
- --loglevel warning
volumes:
- ./redis_data:/var/lib/redis:Z

mysql:
restart: always
image: mysql
container_name: sspanel_mysql
environment:
- MYSQL_ROOT_PASSWORD=sspanel
- MYSQL_DATABASE=sspanel
- MYSQL_USER=sspanel
- MYSQL_PASSWORD=sspanel
volumes:
- ./mysql_data:/var/lib/mysql:Z

ss-panel:
restart: always
image: orvice/ss-panel:master
ports:
- 8080:80
Expand Down
11 changes: 11 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash
echo "Entry ss-panel"

echo -n "waiting for MySQL connection..."

while ! nc -w 1 $DB_HOST 3306 > /dev/null 2>&1
do
echo -n .
sleep 1
done

echo 'ok'

if [ "$MIGRATION" = "false" ];then
echo "Skip database migration"
else
Expand Down