From 9121bf2c0648da90b539ac05510f0486dfd68bea Mon Sep 17 00:00:00 2001 From: "Mr. Hensem Boi" Date: Wed, 13 Jul 2022 14:34:56 +0000 Subject: [PATCH] initial commit --- apache/default.conf | 10 ++++++++++ docker-compose.yaml | 39 +++++++++++++++++++++++++++++++++++++++ php/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 apache/default.conf create mode 100644 docker-compose.yaml create mode 100644 php/Dockerfile diff --git a/apache/default.conf b/apache/default.conf new file mode 100644 index 0000000..2d15f5f --- /dev/null +++ b/apache/default.conf @@ -0,0 +1,10 @@ + + ServerName laravel_docker + DocumentRoot /var/www/laravel_docker/public + + + AllowOverride All + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..2ebd77b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,39 @@ +version: '3.8' + +services: + + laravel: + container_name: laravel + image: laravel/zarif:v1 + ports: + - '80:80' + volumes: + - ./src:/var/www/laravel_docker # add laravel php project in this folder + - ./apache/default.conf:/etc/apache2/sites-enabled/000-default.conf + depends_on: + - database + networks: + laravel-back-network: + + database: + image: mysql:latest + container_name: laravel_database + volumes: + - laravel-db:/var/lib/mysql + restart: unless-stopped + environment: + - MYSQL_RANDOM_ROOT_PASSWORD=yes + - MYSQL_PASSWORD=laravel + - MYSQL_USER=laravel + - MYSQL_DATABASE=laravel + networks: + laravel-back-network: + +volumes: + laravel-db: + +networks: + laravel-back-network: + driver: bridge + +# docker build -t laravel/docker:v1 ./php \ No newline at end of file diff --git a/php/Dockerfile b/php/Dockerfile new file mode 100644 index 0000000..e52ef0d --- /dev/null +++ b/php/Dockerfile @@ -0,0 +1,32 @@ +FROM php:8.0-apache + +RUN apt update && apt install -y \ + g++ \ + libicu-dev \ + libpq-dev \ + libzip-dev \ + zip \ + zlib1g-dev \ + git \ + nano + +RUN docker-php-ext-install \ + intl \ + opcache \ + pdo \ + pdo_mysql \ + pgsql + +WORKDIR /var/www/laravel_docker + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +RUN a2enmod rewrite + +# chown www-data:www-data -R /var/www/laravel_docker + +# composer install +# cp .env.example .env +# php artisan key:generate +# php artisan migrate +# php artisan storage:link \ No newline at end of file