Start building out a PHP container that will run the server.
This commit is contained in:
parent
982d348a34
commit
5c72cdbfd5
@ -2,18 +2,21 @@
|
|||||||
|
|
||||||
namespace Slovocast\Controller;
|
namespace Slovocast\Controller;
|
||||||
|
|
||||||
use Slovocast\Controller\Controller;
|
use Slovocast\Domain\Repository\Channel\ChannelRepositoryInterface;
|
||||||
use Slovocast\Domain\Repository\User\UserRepositoryInterface;
|
use Slovocast\Domain\Repository\User\UserRepositoryInterface;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
|
||||||
class DashboardPage extends Controller
|
class DashboardPage extends Controller
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected UserRepositoryInterface $userRepository
|
protected UserRepositoryInterface $userRepository,
|
||||||
|
protected ChannelRepositoryInterface $channelRepository
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
public function handle(): Response
|
public function handle(): Response
|
||||||
{
|
{
|
||||||
|
// get the user details
|
||||||
|
// get the channels
|
||||||
return $this->render('dashboard.twig');
|
return $this->render('dashboard.twig');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ class Routes
|
|||||||
$app->get('/healthcheck', HealthCheck::class);
|
$app->get('/healthcheck', HealthCheck::class);
|
||||||
// User Routes
|
// User Routes
|
||||||
self::users($app);
|
self::users($app);
|
||||||
|
self::dashboard($app);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,7 +45,10 @@ class Routes
|
|||||||
$app->post('/login', LoginUserAction::class)
|
$app->post('/login', LoginUserAction::class)
|
||||||
->add(AuthenticatedMiddleware::class)
|
->add(AuthenticatedMiddleware::class)
|
||||||
->setName('user-login-action');
|
->setName('user-login-action');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function dashboard(App $app): void
|
||||||
|
{
|
||||||
$app->get('/dashboard', DashboardPage::class)
|
$app->get('/dashboard', DashboardPage::class)
|
||||||
->add(AuthenticatedMiddleware::class)
|
->add(AuthenticatedMiddleware::class)
|
||||||
->setName('user-dashboard');
|
->setName('user-dashboard');
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
{% include 'components/flash.twig' %}
|
{% include 'layouts/components/flash.twig' %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
20
deploy/php/Dockerfile
Normal file
20
deploy/php/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM php:8.3-alpine
|
||||||
|
|
||||||
|
# Install PHP extensions
|
||||||
|
RUN apk add --no-cache zip libzip-dev \
|
||||||
|
&& docker-php-ext-install pdo_mysql zip
|
||||||
|
|
||||||
|
# Install composer
|
||||||
|
RUN curl -sS https://getcomposer.org/installer | php \
|
||||||
|
&& mv composer.phar /usr/bin/composer
|
||||||
|
|
||||||
|
# Install xdebug
|
||||||
|
RUN apk add --no-cache $PHPIZE_DEPS
|
||||||
|
# && pecl install xdebug-2.7.1 \
|
||||||
|
# && docker-php-ext-enable xdebug \
|
||||||
|
# && echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./app /app
|
||||||
|
|
||||||
|
CMD [ "php", "server/server.php" ]
|
@ -12,5 +12,11 @@ services:
|
|||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
volumes:
|
volumes:
|
||||||
- slovocast_db:/var/lib/mysql/data/
|
- slovocast_db:/var/lib/mysql/data/
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
dockerfile: ./deploy/php/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./app:/app
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
slovocast_db:
|
slovocast_db:
|
||||||
|
Loading…
Reference in New Issue
Block a user