Commit 8246863c authored by Winfried's avatar Winfried

Partly reverting 690137a3

parent d4487308
...@@ -4,34 +4,32 @@ type: index ...@@ -4,34 +4,32 @@ type: index
weight: 2 weight: 2
--- ---
## Requirements # Requirements
- [Git](https://git-scm.com/downloads) - [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/products/docker/) `>= 1.12` - [Docker](https://www.docker.com/products/docker/) `>= 1.12`
# Installation
## Installation
Choose the setup the best suits your needs. Choose the setup the best suits your needs.
- [A) Setup for Single Project](#A) - [A) Setup for Single Project](#A)
- [A.1) Already have a PHP project](#A1) - [A.1) Already have a PHP project](#A1)
- [A.2) Don't have a PHP project yet](#A2) - [A.2) Don't have a PHP project yet](#A2)
- [B) Setup for Multiple Projects](#B) - [B) Setup for Multiple Projects](#B)
[]()
## A) Setup for Single Project
<a name="A"></a>
### A) Setup for Single Project
> (Follow these steps if you want a separate Docker environment for each project) > (Follow these steps if you want a separate Docker environment for each project)
[]()
<a name="A1"></a> ## A.1) Already have a PHP project:
### A.1) Already have a PHP project:
1 - Clone laradock on your project root directory: 1 - Clone laradock on your project root directory:
...@@ -39,10 +37,9 @@ Choose the setup the best suits your needs. ...@@ -39,10 +37,9 @@ Choose the setup the best suits your needs.
git submodule add https://github.com/Laradock/laradock.git git submodule add https://github.com/Laradock/laradock.git
``` ```
Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `. Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule`.
*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)*
_To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)_
Your folder structure should look like this: Your folder structure should look like this:
...@@ -53,12 +50,13 @@ Your folder structure should look like this: ...@@ -53,12 +50,13 @@ Your folder structure should look like this:
+ laradock-b + laradock-b
``` ```
*(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project).* _(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project)._
> **Now jump to the [Usage](#Usage) section.** > **Now jump to the [Usage](#Usage) section.**
<a name="A2"></a> []()
### A.2) Don't have a PHP project yet:
## A.2) Don't have a PHP project yet:
1 - Clone this repository anywhere on your machine: 1 - Clone this repository anywhere on your machine:
...@@ -84,19 +82,20 @@ cp env-example .env ...@@ -84,19 +82,20 @@ cp env-example .env
At the top, change the `APPLICATION` variable to your project path. At the top, change the `APPLICATION` variable to your project path.
``` ```
APPLICATION=../project-z/public/ APPLICATION=../project-z/
``` ```
Make sure to replace `project-z` with your project folder name. Make sure to replace `project-z` with your project folder name.
> **Now jump to the [Usage](#Usage) section.** > **Now jump to the [Usage](#Usage) section.**
[]()
## B) Setup for Multiple Projects:
<a name="B"></a>
### B) Setup for Multiple Projects:
> (Follow these steps if you want a single Docker environment for all your project) > (Follow these steps if you want a single Docker environment for all your project)
1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)): 1 - Clone this repository anywhere on your machine (similar to [Steps A.2\. from above](#A2)):
```bash ```bash
git clone https://github.com/laradock/laradock.git git clone https://github.com/laradock/laradock.git
...@@ -127,25 +126,20 @@ You can rename the config files, project folders and domains as you like, just m ...@@ -127,25 +126,20 @@ You can rename the config files, project folders and domains as you like, just m
> **Now jump to the [Usage](#Usage) section.** > **Now jump to the [Usage](#Usage) section.**
[]()
# Usage
<a name="Usage"></a>
## Usage
**Read Before starting:** **Read Before starting:**
If you are using **Docker Toolbox** (VM), do one of the following: If you are using **Docker Toolbox** (VM), do one of the following:
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock) - Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock)
- Use Laradock v3.\*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. *(outdated)* - Use Laradock v3.*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. _(outdated)_
<br> <br>
>**Warning:** If you used an older version of Laradock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent as much errors as possible. > **Warning:** If you used an older version of Laradock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent as much errors as possible.
<br> <br>
...@@ -157,7 +151,6 @@ cp env-example .env ...@@ -157,7 +151,6 @@ cp env-example .env
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used. You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
2 - Build the enviroment and run it using `docker-compose` 2 - Build the enviroment and run it using `docker-compose`
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts: In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
...@@ -168,11 +161,9 @@ docker-compose up -d nginx mysql ...@@ -168,11 +161,9 @@ 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`. **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`.
You can select your own combination of containers form [this list](http://laradock.io/introduction/#supported-software-images). You can select your own combination of containers form [this list](http://laradock.io/introduction/#supported-software-images).
*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).* _(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers)._
<br> <br>
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...) 3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
...@@ -181,7 +172,7 @@ You can select your own combination of containers form [this list](http://larado ...@@ -181,7 +172,7 @@ You can select your own combination of containers form [this list](http://larado
docker-compose exec workspace bash docker-compose exec workspace bash
``` ```
*Alternatively, for Windows PowerShell users: execute the following command to enter any running container:* _Alternatively, for Windows PowerShell users: execute the following command to enter any running container:_
```bash ```bash
docker exec -it {workspace-container-id} bash docker exec -it {workspace-container-id} bash
...@@ -193,7 +184,7 @@ docker exec -it {workspace-container-id} bash ...@@ -193,7 +184,7 @@ docker exec -it {workspace-container-id} bash
docker-compose exec --user=laradock workspace bash docker-compose exec --user=laradock workspace bash
``` ```
*You can change the PUID (User id) and PGID (group id) variables from the `.env` file)* _You can change the PUID (User id) and PGID (group id) variables from the `.env` file)_
<br> <br>
4 - Update your project configurations to use the database host 4 - Update your project configurations to use the database host
...@@ -204,9 +195,7 @@ Open your PHP project's `.env` file or whichever configuration file you are read ...@@ -204,9 +195,7 @@ Open your PHP project's `.env` file or whichever configuration file you are read
DB_HOST=mysql DB_HOST=mysql
``` ```
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).* _If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel)._
<br> <br>
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't 5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't
This diff is collapsed.
<VirtualHost *:80> <VirtualHost *:80>
ServerName sample.dev ServerName sample.dev
DocumentRoot /var/www/sample/ DocumentRoot /var/www/sample/public/
Options Indexes FollowSymLinks Options Indexes FollowSymLinks
<Directory "/var/www/sample/"> <Directory "/var/www/sample/public/">
AllowOverride All AllowOverride All
<IfVersion < 2.4> <IfVersion < 2.4>
Allow from all Allow from all
......
...@@ -14,4 +14,4 @@ RUN apt-get remove --purge -y curl && \ ...@@ -14,4 +14,4 @@ RUN apt-get remove --purge -y curl && \
EXPOSE 2080 EXPOSE 2080
CMD bash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source' CMD bash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source/public'
# Docs: https://caddyserver.com/docs/caddyfile # Docs: https://caddyserver.com/docs/caddyfile
0.0.0.0:80 0.0.0.0:80
root /var/www root /var/www/public
fastcgi / php-fpm:9000 php { fastcgi / php-fpm:9000 php {
index index.php index index.php
} }
......
...@@ -19,6 +19,6 @@ RUN curl --silent --show-error --fail --location \ ...@@ -19,6 +19,6 @@ RUN curl --silent --show-error --fail --location \
EXPOSE 80 443 2015 EXPOSE 80 443 2015
WORKDIR /var/www WORKDIR /var/www/public
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"] CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
### Application Path ### Application Path
# Point to your application code, will be available at `/var/www`. # Point to your application code, will be available at `/var/www`.
APPLICATION=../public/ APPLICATION=../
### Data Path: ### Data Path:
# For all storage systems. # For all storage systems.
...@@ -239,4 +239,3 @@ PHP_IDE_CONFIG=serverName=laradock ...@@ -239,4 +239,3 @@ PHP_IDE_CONFIG=serverName=laradock
# Fix for windows users to make sure the application path works. # Fix for windows users to make sure the application path works.
COMPOSE_CONVERT_WINDOWS_PATHS=1 COMPOSE_CONVERT_WINDOWS_PATHS=1
...@@ -12,7 +12,7 @@ hhvm.log.level = Error ...@@ -12,7 +12,7 @@ hhvm.log.level = Error
hhvm.log.header = true hhvm.log.header = true
hhvm.log.access[default][file] = /var/log/hhvm/access.log hhvm.log.access[default][file] = /var/log/hhvm/access.log
hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b" hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b"
hhvm.server.source_root=/var/www hhvm.server.source_root=/var/www/public
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
; Uncomment to log to files instead of STDOUT ; Uncomment to log to files instead of STDOUT
......
...@@ -4,7 +4,7 @@ server { ...@@ -4,7 +4,7 @@ server {
listen [::]:80 default_server ipv6only=on; listen [::]:80 default_server ipv6only=on;
server_name localhost; server_name localhost;
root /var/www; root /var/www/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
...@@ -30,6 +30,3 @@ server { ...@@ -30,6 +30,3 @@ server {
log_not_found off; log_not_found off;
} }
} }
...@@ -4,7 +4,7 @@ server { ...@@ -4,7 +4,7 @@ server {
listen [::]:80; listen [::]:80;
server_name project-1.dev; server_name project-1.dev;
root /var/www/project-1; root /var/www/project-1/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
...@@ -30,6 +30,3 @@ server { ...@@ -30,6 +30,3 @@ server {
log_not_found off; log_not_found off;
} }
} }
...@@ -4,7 +4,7 @@ server { ...@@ -4,7 +4,7 @@ server {
listen [::]:80; listen [::]:80;
server_name project-2.dev; server_name project-2.dev;
root /var/www/project-2; root /var/www/project-2/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
...@@ -30,6 +30,3 @@ server { ...@@ -30,6 +30,3 @@ server {
log_not_found off; log_not_found off;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment