- Pindahkan file
docker-compose.ymlkedalam direktori project - Tambahkan environment untuk port yang akan digunakan mengakses project, pada macOS dan Linux menggunakan perintah
export PORT_EXPOSE=8080 - Jalankan perintah
docker-compose startuntuk menjalankan server - Siap digunakan
Last active
July 3, 2019 08:44
-
-
Save kudaliar032/7259bc6f09b6af6d348cc493bac0f2cf to your computer and use it in GitHub Desktop.
Tambahkan environment untuk port yang digunakan mengakses webnya, export PORT_EXPOSE=8080
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MYSQL_ROOT_PASSWORD=toor | |
| MYSQL_USER=dot_test | |
| MYSQL_PASSWORD=dot_test | |
| MYSQL_DATABASE=dot_test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.7" | |
| services: | |
| webapp: | |
| image: "kudaliar032/dot-php:7.3" | |
| volumes: | |
| - type: bind | |
| source: . | |
| target: /var/www/html | |
| ports: | |
| - "${PORT_EXPOSE}:80" | |
| database: | |
| image: "mariadb:latest" | |
| env_file: | |
| - database.env | |
| volumes: | |
| - database-vol:/var/lib/mysql | |
| volumes: | |
| database-vol: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM php:7.3-apache | |
| # update repos and install lib | |
| RUN apt update -y && apt install -y libcurl4-gnutls-dev libicu-dev \ | |
| libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev \ | |
| libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev \ | |
| unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev \ | |
| libsnmp-dev libpcre3-dev libtidy-dev zip unzip gnupg libzip-dev | |
| # install php extension | |
| RUN pecl install mongodb-1.5.1 | |
| RUN docker-php-ext-install pdo_mysql intl gd zip bz2 opcache ldap bcmath | |
| RUN echo "extension=mongodb.so" >> /usr/local/etc/php/conf.d/mongodb.ini | |
| # change vhost directory | |
| RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf && \ | |
| sed -ri -e 's!/var/www/!/var/www/html/public!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf | |
| # install composer | |
| RUN curl -sS https://getcomposer.org/installer | php && \ | |
| mv composer.phar /usr/bin/composer | |
| # enable apache2 modul | |
| RUN a2enmod rewrite | |
| # clean cache | |
| RUN rm -rf /var/cache/apt/archives/* && rm -rf /tmp/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment