Skip to content

Commit

Permalink
PHP8.0-apache with PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
guizoxxv committed Feb 27, 2021
1 parent 8d72680 commit 0c83707
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
33 changes: 11 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,35 @@
FROM php:7.3-apache
FROM php:8-apache

ENV APACHE_DOCUMENT_ROOT ${APACHE_DOCUMENT_ROOT:-/var/www/html/public}

RUN apt update
RUN apt-get update

# Required for zip; php zip extension; png; node; vim; gd; gd; cron;
RUN apt install -y zip libzip-dev libpng-dev gnupg vim libfreetype6-dev libjpeg62-turbo-dev cron
# Required for zip; php zip extension; png; node; vim; gd; gd; postgres;
RUN apt install -y zip libzip-dev libpng-dev gnupg vim libfreetype6-dev libjpeg62-turbo-dev libpq-dev

# PHP extensions - pdo-mysql; zip (used to download packages with Composer); mbstring; exif
RUN docker-php-ext-install pdo_mysql zip mbstring exif
# PHP extensions - pdo-pgsql; zip (used to download packages with Composer); exif
RUN docker-php-ext-install pdo_pgsql zip exif

# PHP extension - GD (image library)
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install gd

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Install Node.js
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt install -y nodejs
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs

# Copy custom apache virtual host configuration into container
COPY apache.conf /etc/apache2/sites-available/000-default.conf

# Copy start stript into container
COPY start.sh /usr/local/bin/start

# Set apache folder permission
RUN chown -R www-data:www-data /var/www

# Activate Apache mod_rewrite
RUN a2enmod rewrite

# Set up the scheduler for Laravel
RUN echo '* * * * * cd /var/www/html && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1' | crontab -

# Set start script permission
RUN chmod u+x /usr/local/bin/start

# Cleanup
RUN apt clean
RUN apt autoclean

CMD ["/usr/local/bin/start"]
RUN apt-get clean
RUN apt-get autoclean
6 changes: 0 additions & 6 deletions start.sh

This file was deleted.

0 comments on commit 0c83707

Please sign in to comment.