diff --git a/Dockerfile b/Dockerfile index ff9ba768..d230ac00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,25 @@ -FROM ghcr.io/biblioverse/biblioteca-docker:latest +FROM ghcr.io/biblioverse/biblioteca-docker:latest AS base +WORKDIR /var/www/html +FROM base AS prod USER root COPY . /var/www/html - - -WORKDIR /var/www/html - RUN composer install RUN npm install RUN npm run build RUN chown -R www-data:www-data /var/www/html +USER www-data + +FROM base AS dev +USER root +RUN /usr/local/bin/install-php-extensions xdebug + +RUN echo ' \n\ +[xdebug] \n\ +xdebug.idekey=PHPSTORM \n\ +xdebug.mode=off \n\ +xdebug.client_host=host.docker.internal\n ' >> /usr/local/etc/php/conf.d/biblioteca.ini USER www-data \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 648713c5..57bedfb4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: biblioteca: image: ghcr.io/biblioverse/biblioteca-docker:latest + build: + target: prod command: ["/bin/sh", "-c" , "crontab /var/www/html/config/crontab.txt && apache2-foreground" ] ports: - "48480:8080" # Web