initial commit
This commit is contained in:
commit
9121bf2c06
10
apache/default.conf
Normal file
10
apache/default.conf
Normal file
@ -0,0 +1,10 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName laravel_docker
|
||||
DocumentRoot /var/www/laravel_docker/public
|
||||
|
||||
<Directory /var/www/laravel_docker>
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
</VirtualHost>
|
39
docker-compose.yaml
Normal file
39
docker-compose.yaml
Normal file
@ -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
|
32
php/Dockerfile
Normal file
32
php/Dockerfile
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user