diff --git a/Dockerfile b/Dockerfile index de2c9eb..6735364 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ # - `initial_influence`. https://dev.to/veevidify/docker-compose-up-your-entire-laravel-apache-mysql-development-environment-45ea # - `libonig-dev`. https://www.limstash.com/en/articles/202002/1539 -FROM php:8.2-apache AS base +FROM php:8.2-cli AS base # 1. Install necessary packages. RUN apt-get update && apt-get install -y \ @@ -21,11 +21,11 @@ RUN apt-get update && apt-get install -y \ # 2. Apache configs + document root. # RUN echo "ServerName server.peratorakka.local" >> /etc/apache2/apache2.conf -RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!/var/www/html/public!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf +# RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf +# RUN sed -ri -e 's!/var/www/!/var/www/html/public!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf # 3. mod_rewrite for URL rewrite and mod_headers for .htaccess extra headers like Access-Control-Allow-Origin- -RUN a2enmod rewrite headers +# RUN a2enmod rewrite headers # 4. Copy base PHP config from development. RUN cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" @@ -131,7 +131,6 @@ RUN rm -rf /var/lib/apt/lists/* # 7. Install composer. COPY --from=composer:latest /usr/bin/composer /usr/bin/composer - ########## @@ -160,5 +159,8 @@ RUN sudo chmod -R a+rw /var/www/html/vendor # 5. Migrate all tables RUN /usr/bin/composer run seed:initial -# 6. Restart HTTP service to apply changes -RUN service apache2 restart +# 6. Start HTTP service to apply changes +# RUN service apache2 restart +CMD [ "php", "spark", "serve", "--host=0.0.0.0", "--port=80" ] + +EXPOSE 80