Skip to content

Instantly share code, notes, and snippets.

@deanet
Created April 6, 2021 09:56
Show Gist options
  • Save deanet/6320a0ca912bf9177fdff8dc072945ed to your computer and use it in GitHub Desktop.
Save deanet/6320a0ca912bf9177fdff8dc072945ed to your computer and use it in GitHub Desktop.

Revisions

  1. deanet created this gist Apr 6, 2021.
    40 changes: 40 additions & 0 deletions Dockerfile-specialacademy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    FROM php:7.2-apache-stretch

    LABEL maintener="dian prasetya <[email protected]>"

    ENV APP_ENV=dev
    ENV DB_MYSQL_HOST=localhost
    ENV DB_MYSQL_PORT=3306
    ENV DB_MYSQL_DATABASE=spe_acc
    ENV DB_MYSQL_USERNAME=user
    ENV DB_MYSQL_PASSWORD=password
    ENV DB_MONGODB_HOST=localhost
    ENV DB_MONGODB_PORT=27017
    ENV DB_MONGODB_DATABASE=spe_acc

    COPY . /var/www/html/special-academy

    WORKDIR /var/www/html/special-academy

    RUN apt update
    RUN apt install -y git unzip zip nano
    RUN pecl install mongodb
    RUN docker-php-ext-install pdo_mysql
    RUN echo "extension=mongodb.so" >> /usr/local/etc/php/conf.d/mongodb.ini
    RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    RUN php composer-setup.php
    RUN php -r "unlink('composer-setup.php');"
    RUN mv composer.phar /usr/local/bin/composer
    RUN composer install --ignore-platform-reqs
    RUN a2enmod rewrite
    RUN sed -i 's/\/var\/www\/html/\/var\/www\/html\/special-academy\/public/g' /etc/apache2/sites-enabled/000-default.conf
    RUN sed -i 's|#ServerName www.example.com|TimeOut 0|' /etc/apache2/sites-enabled/000-default.conf
    RUN mkdir storage/app/public/upload
    RUN chmod 777 storage/app/public/upload
    RUN php artisan storage:link
    RUN chown -R www-data:www-data .
    RUN chmod 755 startup.sh

    CMD ["./startup.sh"]

    EXPOSE 80