Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
4fe15ad5cf | |||
146f8ea6f4 | |||
9ab6d8fa15 | |||
f6d9ac6853 | |||
470994fc23 | |||
1b05dfd1e2 | |||
03bba8d2de | |||
b6c7746a0d | |||
e7baf3cfc3 | |||
f630970151 | |||
3070eac7b7 | |||
66723c0278 | |||
dbee864d44 | |||
739cc31f4c | |||
28130c5907 | |||
658d4e7532 | |||
5da4058613 | |||
2ed09f42ca |
@ -471,13 +471,13 @@ composer create-project laravel/laravel my-cool-app "5.2.*"
|
||||
系统默认LaraDock假定Laravel应用在LaraDock的父级目录中
|
||||
By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||
|
||||
自新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www/laravel`替换 `../:/var/www/laravel` , 如下:
|
||||
自新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下:
|
||||
|
||||
```yaml
|
||||
application:
|
||||
build: ./application
|
||||
volumes:
|
||||
- ../my-cool-app/:/var/www/laravel
|
||||
- ../my-cool-app/:/var/www
|
||||
```
|
||||
4 - 进入目录下继续工作..
|
||||
|
||||
|
97
README.md
97
README.md
@ -60,6 +60,7 @@ Laradock is configured to run Laravel Apps by default, and it can be modifyed to
|
||||
- [Cron jobs](#CronJobs)
|
||||
- [Access workspace via ssh](#Workspace-ssh)
|
||||
- [MySQL access from host](#MySQL-access-from-host)
|
||||
- [MySQL root access](#MySQL-root-access)
|
||||
- [Use custom Domain](#Use-custom-Domain)
|
||||
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
|
||||
- [Install Prestissimo](#Install-Prestissimo)
|
||||
@ -206,17 +207,22 @@ What's better than a **Demo Video**:
|
||||
<a name="Installation"></a>
|
||||
## Installation
|
||||
|
||||
Choose the setup the best suits your needs.
|
||||
|
||||
Clone the `LaraDock` repository:
|
||||
#### A) Setup for Single Project:
|
||||
*(In case you want a Docker environment for each project)*
|
||||
|
||||
**A)** If you already have a Laravel project, clone this repository on your `Laravel` root directory:
|
||||
##### A.1) Setup environment in existing Project:
|
||||
*(In case you already have a project, and you want to setup an environemnt to run it)*
|
||||
|
||||
1 - Clone this repository on your project root directory:
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/LaraDock/laradock.git
|
||||
```
|
||||
>If you are not already using Git for your Laravel project, you can use `git clone` instead of `git submodule`.
|
||||
>If you are not already using Git for your PHP project, you can use `git clone` instead of `git submodule`.
|
||||
|
||||
Note: In this case the folder structure will be like this (recommended):
|
||||
Note: In this case the folder structure will be like this:
|
||||
|
||||
```
|
||||
- project1
|
||||
@ -225,9 +231,10 @@ Note: In this case the folder structure will be like this (recommended):
|
||||
- laradock
|
||||
```
|
||||
|
||||
<br>
|
||||
##### A.2) Setup environment first then create project:
|
||||
*(In case you don't have a project, and you want to create your project inside the Docker environment)*
|
||||
|
||||
**B)** If you don't have a Laravel project, and you want to install Laravel from Docker, clone this repo anywhere on your machine:
|
||||
1 - Clone this repository anywhere on your machine:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/LaraDock/laradock.git
|
||||
@ -237,11 +244,54 @@ Note: In this case the folder structure will be like this:
|
||||
```
|
||||
- projects
|
||||
- laradock
|
||||
- project1
|
||||
- project2
|
||||
- myProject
|
||||
```
|
||||
|
||||
**Note:** if you are using this folder structure don't forget to edit the `docker-compose.yml` file to map to your Laravel directory once you have it (example: `- ../project1/:/var/www/laravel`). "You will need to stop and re-run your docker-compose command for the changes to take place".
|
||||
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`).
|
||||
|
||||
3 - Stop and re-run your docker-compose command for the changes to take place.
|
||||
|
||||
```
|
||||
docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
||||
```
|
||||
|
||||
|
||||
#### B) Setup for Multiple Projects:
|
||||
|
||||
1 - Clone this repository anywhere on your machine:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/LaraDock/laradock.git
|
||||
```
|
||||
|
||||
2 - Edit the `docker-compose.yml` file to map to your projects directories:
|
||||
|
||||
```
|
||||
applications:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../project1/:/var/www/project1
|
||||
- ../project2/:/var/www/project2
|
||||
```
|
||||
|
||||
3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup nginx quickly.
|
||||
|
||||
|
||||
4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf`
|
||||
|
||||
5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow:
|
||||
|
||||
```
|
||||
server_name project1.dev;
|
||||
root /var/www/project1/public;
|
||||
```
|
||||
Do the same for each project `project2.conf`, `project3.conf`,...
|
||||
|
||||
6 - Create your project Databases **To Be Continue..**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Usage"></a>
|
||||
## Usage
|
||||
@ -267,7 +317,7 @@ If you are using **Docker Toolbox** (VM), do one of the following:
|
||||
**Example:** Running NGINX and MySQL:
|
||||
|
||||
```bash
|
||||
docker-compose up -d nginx mysql
|
||||
docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
|
||||
@ -305,7 +355,7 @@ Open your `.env` file and set the `DB_HOST` to `mysql`:
|
||||
DB_HOST=mysql
|
||||
```
|
||||
|
||||
*If you are using Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
|
||||
*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
|
||||
|
||||
|
||||
|
||||
@ -371,8 +421,6 @@ docker-compose stop {container-name}
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
*Note: Careful with this command as it will delete your Data Volume Container as well. (if you want to keep your Database data than you should stop each container by itself as follow):*
|
||||
|
||||
|
||||
|
||||
|
||||
@ -744,13 +792,13 @@ For more about the Laravel installation click [here](https://laravel.com/docs/ma
|
||||
|
||||
By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||
|
||||
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www/laravel` with `../my-cool-app/:/var/www/laravel`, as follow:
|
||||
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow:
|
||||
|
||||
```yaml
|
||||
application:
|
||||
build: ./application
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../my-cool-app/:/var/www/laravel
|
||||
- ../my-cool-app/:/var/www
|
||||
...
|
||||
```
|
||||
4 - Go to that folder and start working..
|
||||
@ -1064,7 +1112,7 @@ We also recommend [setting the timezone in Laravel](http://www.camroncade.com/ma
|
||||
You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line.
|
||||
|
||||
```
|
||||
* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1
|
||||
* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1
|
||||
|
||||
# Custom cron
|
||||
* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
|
||||
@ -1096,6 +1144,21 @@ ports:
|
||||
- "3306:3306"
|
||||
```
|
||||
|
||||
<a name="MySQL-root-access"></a>
|
||||
### MySQL root access
|
||||
|
||||
The default username and password for the root mysql user are `root` and `root `.
|
||||
|
||||
1 - Enter the mysql contaier: `docker-compose exec mysql bash`.
|
||||
|
||||
2 - Enter mysql: `mysql -uroot -proot` for non root access use `mysql -uhomestead -psecret`.
|
||||
|
||||
3 - See all users: `SELECT User FROM mysql.user;`
|
||||
|
||||
4 - Run any commands `show databases`, `show tables`, `select * from.....`.
|
||||
|
||||
|
||||
|
||||
<a name="Use-custom-Domain"></a>
|
||||
### Use custom Domain (instead of the Docker IP)
|
||||
|
||||
|
@ -58,10 +58,10 @@ docker-compose exec workspace bash
|
||||
#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder
|
||||
|
||||
```
|
||||
$ root@0e77851d27d3:/var/www/laravel# composer install
|
||||
$ root@0e77851d27d3:/var/www/laravel# cp .env.example .env
|
||||
$ root@0e77851d27d3:/var/www/laravel# php artisan key:generate
|
||||
$ root@0e77851d27d3:/var/www/laravel# exit
|
||||
$ root@0e77851d27d3:/var/www# composer install
|
||||
$ root@0e77851d27d3:/var/www# cp .env.example .env
|
||||
$ root@0e77851d27d3:/var/www# php artisan key:generate
|
||||
$ root@0e77851d27d3:/var/www# exit
|
||||
$root@midascode:~/laravel/laradock# cd ..
|
||||
$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache
|
||||
```
|
||||
@ -141,13 +141,13 @@ Remove 0.0.0.0:80
|
||||
|
||||
```
|
||||
0.0.0.0:80
|
||||
root /var/www/laravel/public
|
||||
root /var/www/public
|
||||
```
|
||||
and replace with your https://yourdomain.com
|
||||
|
||||
```
|
||||
https://yourdomain.com
|
||||
root /var/www/laravel/public
|
||||
root /var/www/public
|
||||
```
|
||||
uncomment tls
|
||||
|
||||
|
@ -6,11 +6,11 @@ ARG PHP_SOCKET=php-fpm:9000
|
||||
|
||||
ENV WEB_PHP_SOCKET=$PHP_SOCKET
|
||||
|
||||
ENV WEB_DOCUMENT_ROOT=/var/www/laravel/public
|
||||
ENV WEB_DOCUMENT_ROOT=/var/www/public
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
WORKDIR /var/www/laravel/public
|
||||
WORKDIR /var/www/public
|
||||
|
||||
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Docs: https://caddyserver.com/docs/caddyfile
|
||||
0.0.0.0:80
|
||||
root /var/www/laravel/public
|
||||
root /var/www/public
|
||||
fastcgi / php-fpm:9000 php {
|
||||
index index.php
|
||||
}
|
||||
|
@ -19,6 +19,6 @@ RUN curl --silent --show-error --fail --location \
|
||||
|
||||
EXPOSE 80 443 2015
|
||||
|
||||
WORKDIR /var/www/laravel/public
|
||||
WORKDIR /var/www/public
|
||||
|
||||
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
|
||||
|
@ -2,6 +2,14 @@ version: '2'
|
||||
|
||||
services:
|
||||
|
||||
### Applications Code Container #############################
|
||||
|
||||
applications:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../:/var/www
|
||||
# - ../sample/:/var/www/sample
|
||||
|
||||
### Workspace Utilities Container ###########################
|
||||
|
||||
workspace:
|
||||
@ -21,7 +29,7 @@ services:
|
||||
- NODE_VERSION=stable
|
||||
- TZ=UTC
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
- applications
|
||||
extra_hosts:
|
||||
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
||||
- "dockerhost:10.0.75.1"
|
||||
@ -44,7 +52,7 @@ services:
|
||||
- CODEIGNITER=false
|
||||
dockerfile: Dockerfile-70
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
- applications
|
||||
expose:
|
||||
- "9000"
|
||||
links:
|
||||
@ -64,7 +72,7 @@ services:
|
||||
args:
|
||||
- PHP_UPSTREAM=php-fpm
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
- applications
|
||||
volumes:
|
||||
- ./logs/nginx/:/var/log/nginx
|
||||
ports:
|
||||
@ -73,7 +81,7 @@ services:
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
### Apache Server Container ##################################
|
||||
### Apache Server Container #################################
|
||||
|
||||
apache2:
|
||||
build:
|
||||
@ -81,7 +89,7 @@ services:
|
||||
args:
|
||||
- PHP_SOCKET=php-fpm:9000
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
- applications
|
||||
volumes:
|
||||
- ./logs/apache2:/var/log/apache2
|
||||
ports:
|
||||
@ -95,7 +103,7 @@ services:
|
||||
hhvm:
|
||||
build: ./hhvm
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
- applications
|
||||
expose:
|
||||
- "9000"
|
||||
links:
|
||||
@ -105,8 +113,8 @@ services:
|
||||
|
||||
mysql:
|
||||
build: ./mysql
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
@ -119,8 +127,8 @@ services:
|
||||
|
||||
mariadb:
|
||||
build: ./mariadb
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- mariadb
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
@ -133,8 +141,8 @@ services:
|
||||
|
||||
postgres:
|
||||
build: ./postgres
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
@ -151,8 +159,8 @@ services:
|
||||
- "1337:1337"
|
||||
environment:
|
||||
- NEO4J_AUTH=homestead:secret
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- neo4j:/var/lib/neo4j/data
|
||||
|
||||
### MongoDB Container #######################################
|
||||
|
||||
@ -160,25 +168,26 @@ services:
|
||||
build: ./mongo
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- mongo:/data/db
|
||||
|
||||
### Redis Container #########################################
|
||||
|
||||
redis:
|
||||
build: ./redis
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- redis:/data
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
### Aerospike c Container #########################################
|
||||
### Aerospike c Container ###################################
|
||||
|
||||
aerospike:
|
||||
build: ./aerospike
|
||||
volumes_from:
|
||||
- workspace
|
||||
- volumes_data
|
||||
volumes:
|
||||
- aerospike:/opt/aerospike/data
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3001"
|
||||
@ -190,8 +199,8 @@ services:
|
||||
|
||||
memcached:
|
||||
build: ./memcached
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- memcached:/var/lib/memcached
|
||||
ports:
|
||||
- "11211:11211"
|
||||
links:
|
||||
@ -207,7 +216,7 @@ services:
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
### RabbitMQ Container ####################################
|
||||
### RabbitMQ Container ######################################
|
||||
|
||||
rabbitmq:
|
||||
build: ./rabbitmq
|
||||
@ -236,8 +245,9 @@ services:
|
||||
caddy:
|
||||
build: ./caddy
|
||||
volumes_from:
|
||||
- volumes_source
|
||||
- volumes_data
|
||||
- applications
|
||||
volumes:
|
||||
- caddy:/root/.caddy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
@ -248,7 +258,7 @@ services:
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
### phpMyAdmin Container ##################################
|
||||
### phpMyAdmin Container ####################################
|
||||
|
||||
phpmyadmin:
|
||||
build: ./phpmyadmin
|
||||
@ -257,8 +267,8 @@ services:
|
||||
MYSQL_USER: homestead
|
||||
MYSQL_PASSWORD: secret
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- phpmyadmin
|
||||
ports:
|
||||
- "8080:80"
|
||||
links:
|
||||
@ -267,7 +277,7 @@ services:
|
||||
# for mariadb container
|
||||
# - "mariadb:db"
|
||||
|
||||
### pgAdmin Container ##################################
|
||||
### pgAdmin Container #######################################
|
||||
|
||||
pgadmin:
|
||||
build: ./pgadmin
|
||||
@ -276,40 +286,45 @@ services:
|
||||
links:
|
||||
- postgres
|
||||
|
||||
### ElasticSearch Container ##################################
|
||||
### ElasticSearch Container #################################
|
||||
|
||||
elasticsearch:
|
||||
build: ./elasticsearch
|
||||
volumes_from:
|
||||
- volumes_data
|
||||
volumes:
|
||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||
- elasticsearch-pkugins:/usr/share/elasticsearch/data
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
### Laravel Application Code Container ######################
|
||||
### Volumes Setup ###########################################
|
||||
|
||||
volumes_source:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../:/var/www/laravel
|
||||
|
||||
### Databases Data Container ################################
|
||||
|
||||
volumes_data:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ./data/mysql:/var/lib/mysql
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
- ./data/memcached:/var/lib/memcached
|
||||
- ./data/redis:/data
|
||||
- ./data/neo4j:/var/lib/neo4j/data
|
||||
- ./data/mongo:/data/db
|
||||
- ./data/aerospike:/opt/aerospike/data
|
||||
- ./data/sessions:/sessions
|
||||
- ./data/caddy:/root/.caddy
|
||||
- ./data/elasticsearch/data:/usr/share/elasticsearch/data
|
||||
- ./data/elasticsearch/pkugins:/usr/share/elasticsearch/pkugins
|
||||
|
||||
### Add more Containers below ###############################
|
||||
volumes:
|
||||
mysql:
|
||||
driver: "local"
|
||||
postgres:
|
||||
driver: "local"
|
||||
memcached:
|
||||
driver: "local"
|
||||
redis:
|
||||
driver: "local"
|
||||
neo4j:
|
||||
driver: "local"
|
||||
mariadb:
|
||||
driver: "local"
|
||||
mongo:
|
||||
driver: "local"
|
||||
phpmyadmin:
|
||||
driver: "local"
|
||||
aerospike:
|
||||
driver: "local"
|
||||
caddy:
|
||||
driver: "local"
|
||||
elasticsearch-data:
|
||||
driver: "local"
|
||||
elasticsearch-pkugins:
|
||||
driver: "local"
|
||||
sessions: ## nothing is connected to this (- ./data/sessions:/sessions)
|
||||
driver: "local"
|
||||
|
@ -10,13 +10,13 @@ RUN apt-get update -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir -p /var/www/laravel
|
||||
RUN mkdir -p /var/www
|
||||
|
||||
ADD server.ini /etc/hhvm/server.ini
|
||||
|
||||
RUN usermod -u 1000 www-data
|
||||
|
||||
WORKDIR /var/www/laravel
|
||||
WORKDIR /var/www
|
||||
|
||||
CMD ["/usr/bin/hhvm", "-m", "server", "-c", "/etc/hhvm/server.ini"]
|
||||
|
||||
|
@ -12,7 +12,7 @@ hhvm.log.level = Error
|
||||
hhvm.log.header = true
|
||||
hhvm.log.access[default][file] = /var/log/hhvm/access.log
|
||||
hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b"
|
||||
hhvm.server.source_root=/var/www/laravel/public
|
||||
hhvm.server.source_root=/var/www/public
|
||||
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
|
||||
|
||||
; Uncomment to log to files instead of STDOUT
|
||||
|
@ -3,8 +3,8 @@ server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server ipv6only=on;
|
||||
|
||||
server_name laravel;
|
||||
root /var/www/laravel/public;
|
||||
server_name laradock;
|
||||
root /var/www/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
@ -1,57 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
#domain name
|
||||
server_name drupal8.dev;
|
||||
|
||||
#file document root. This has to match one of the volumes in docer-composer.yml
|
||||
root /var/www/drupal8;
|
||||
|
||||
# This is the full path to your index file
|
||||
index index.php index.html index.htm;
|
||||
|
||||
## serve imagecache files directly or redirect to drupal if they do not exist.
|
||||
location ~* files/styles {
|
||||
access_log off;
|
||||
expires 30d;
|
||||
try_files $uri @drupal;
|
||||
}
|
||||
|
||||
## serve imagecache files directly or redirect to drupal if they do not exist.
|
||||
location ~* ^.+.(xsl|xml)$ {
|
||||
access_log off;
|
||||
expires 1d;
|
||||
try_files $uri @drupal;
|
||||
}
|
||||
|
||||
## Images and static content is treated different
|
||||
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
||||
access_log off;
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
location / {
|
||||
index index.php;
|
||||
# This is cool because no php is touched for static content
|
||||
try_files $uri $uri/ @rewrite;
|
||||
expires max;
|
||||
}
|
||||
|
||||
location @drupal {
|
||||
rewrite ^/(.*)$ /index.php?q=$1 last;
|
||||
}
|
||||
|
||||
location @rewrite {
|
||||
# Some modules enforce no slash (/) at the end of the URL
|
||||
# Else this rewrite block wouldn't be needed (GlobalRedirect)
|
||||
rewrite ^/(.*)$ /index.php?q=$1;
|
||||
}
|
||||
|
||||
location ~ .php$ {
|
||||
fastcgi_pass php-upstream;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
@ -3,8 +3,8 @@ server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name site_a;
|
||||
root /var/www/site_a/public;
|
||||
server_name sample.dev;
|
||||
root /var/www/sample/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
@ -1,28 +0,0 @@
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name site_b;
|
||||
root /var/www/site_b/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files $uri /index.php =404;
|
||||
fastcgi_pass php-upstream;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,7 +142,7 @@ RUN rm -r /var/lib/apt/lists/*
|
||||
|
||||
RUN usermod -u 1000 www-data
|
||||
|
||||
WORKDIR /var/www/laravel
|
||||
WORKDIR /var/www
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
|
@ -153,7 +153,7 @@ RUN rm -r /var/lib/apt/lists/*
|
||||
|
||||
RUN usermod -u 1000 www-data
|
||||
|
||||
WORKDIR /var/www/laravel
|
||||
WORKDIR /var/www
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
|
@ -45,12 +45,12 @@ services:
|
||||
links:
|
||||
- workspace
|
||||
|
||||
### Laravel Application Code Container ######################
|
||||
### Application Code Container ######################
|
||||
|
||||
volumes_source:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../:/var/www/laravel
|
||||
- ../:/var/www
|
||||
|
||||
### Databases Data Container ################################
|
||||
|
||||
|
@ -91,7 +91,7 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||
apt-get update && \
|
||||
apt-get install -y --force-yes php7.0-xdebug && \
|
||||
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
|
||||
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
|
||||
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
|
||||
;fi
|
||||
# ADD for REMOTE debugging
|
||||
COPY ./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini
|
||||
@ -234,6 +234,16 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \
|
||||
rm /etc/php/7.0/cli/conf.d/aerospike.ini \
|
||||
;fi
|
||||
|
||||
#####################################
|
||||
# Non-root user : PHPUnit path
|
||||
#####################################
|
||||
|
||||
# add ./vendor/bin to non-root user's bashrc (needed for phpunit)
|
||||
USER laradock
|
||||
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Final Touch
|
||||
@ -246,4 +256,4 @@ RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Set default work directory
|
||||
WORKDIR /var/www/laravel
|
||||
WORKDIR /var/www
|
||||
|
@ -1 +1 @@
|
||||
* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1
|
||||
* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1
|
||||
|
Reference in New Issue
Block a user