From 59545b4fedab13578ed2ddab378dbaf76ab9f691 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Tue, 21 May 2024 12:51:05 +0200 Subject: [PATCH] Updated dockerfile, and config --- README.md | 14 +++++++++++--- config/packages/security.yaml | 1 + docker/Dockerfile-php | 15 --------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4aafac9..df93e13 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,17 @@ docker ps Y deberiamos ver algo parecido a : -- ogcore-nginx-1 -- ogcore-php-1 -- ogcore-database-1 +- ogcore-nginx +- ogcore-php +- ogcore-database + + +### Instalamos dependencias + +```sh +docker exec ogcore-php composer install +docker exec ogcore-php symfony console lexik:jwt:generate-keypair --overwrite +``` Comprobamos, que el contenedor de Nginx, tiene el puerto 8080 levantado correctamente, asi que tan solo tendremos que acceder a la siguiente URL: diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 5ec2849..978777f 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -16,6 +16,7 @@ security: entry_point: jwt json_login: check_path: auth + provider: app_user_provider username_path: username password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success diff --git a/docker/Dockerfile-php b/docker/Dockerfile-php index 6bc5967..02a3f56 100644 --- a/docker/Dockerfile-php +++ b/docker/Dockerfile-php @@ -1,7 +1,6 @@ FROM php:8.3-fpm-alpine ENV COMPOSER_ALLOW_SUPERUSER=1 - # Install PHP extensions RUN docker-php-ext-install pdo mysqli pdo_mysql opcache @@ -24,17 +23,3 @@ RUN install-php-extensions sockets RUN apk add --no-cache bash \ && curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.alpine.sh' | bash \ && apk add symfony-cli - -# Expose webroot -VOLUME /var/www/html -WORKDIR /var/www/html -COPY . /var/www/html - -RUN cd /var/www/html \ - && composer install --no-interaction --no-progress --prefer-dist --no-scripts \ - && php bin/console cache:clear --no-warmup \ - && php bin/console cache:warmup \ - && php bin/console assets:install public \ - && php bin/console lexik:jwt:generate-keypair --overwrite \ - && mkdir -p var/cache var/log \ - && chmod -R 777 var/cache var/log \ No newline at end of file