Laradock on Docker of Windows
Laravel을 사용하기 위해 Laradoc에서 개발 환경을 정리해보십시오.
Docker도 공부중이므로, 탐구하면서 해 본다.
PC 환경
Docker, git이 설치되어 있다고 가정합니다.
Laradock 개요
라라벨 의 Docker 개발 환경
Laradoc 문서
※ Laravel에는 Homestead라는 vagrant의 공식 개발 환경이 있다.
Laradoc에서 지원되는 소프트웨어
PostgreSQL - Postgres-PostGIS.
이것들로부터 필요한 소프트웨어를 선택해, 환경 구축할 수 있다.
Workspace는 Laravel 설정 등을 수행하는 환경
절차
Laradoc의 초기 도입
> git clone https://github.com/laradock/laradock
Cloning into 'laradock'...
remote: Counting objects: 5124, done.
remote: Total 5124 (delta 0), reused 0 (delta 0), pack-reused 5124
Receiving objects: 100% (5124/5124), 5.41 MiB | 335.00 KiB/s, done.
Resolving deltas: 100% (2650/2650), done.
> cd laradock
> cp env-example .env
> docker-compose up -d workspace
Creating network "laradock_default" with the default driver
Creating network "laradock_frontend" with driver "bridge"
Creating network "laradock_backend" with driver "bridge"
Creating laradock_applications_1
Creating laradock_workspace_1
> docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------
laradock_applications_1 /true Exit 0
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
Laravel 프로젝트 만들기
> docker exec -it laradock_workspace_1 bash
root@493f7944504f:/var/www#
root@493f7944504f:/var/www# composer create-project laravel/laravel larapj1
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Installing laravel/laravel (v5.4.23)
- Installing laravel/laravel (v5.4.23): Downloading (100%)
Created project in larapj1
> php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 59 installs, 0 updates, 0 removals
- Installing symfony/css-selector (v3.3.2): Downloading (100%)
- Installing tijsverkoyen/css-to-inline-styles (2.2.0): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.4.0): Downloading (100%)
- Installing symfony/var-dumper (v3.3.2): Downloading (100%)
- Installing jakub-onderka/php-console-color (0.1): Downloading (100%)
- Installing jakub-onderka/php-console-highlighter (v0.3.2): Downloading (100%)
- Installing dnoegel/php-xdg-base-dir (0.1): Downloading (100%)
...
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader
The compiled services file has been removed.
> php artisan key:generate
Application key [base64:VwRbtlHayxyJ3b8sIzZfHXRH6XikH/E8bNihDa/CiLk=] set successfully.
root@493f7944504f:/var/www#exit
exit
> docker-compose stop
Stopping laradock_workspace_1 ... done
>
docker-compose.yml
version: '2'
services:
### Applications Code Container #############################
applications:
image: tianon/true
volumes:
- ../larapj1:/var/www
> docker-compose up -d nginx mysql
Creating network "laradock_default" with the default driver
Creating network "laradock_frontend" with driver "bridge"
Creating network "laradock_backend" with driver "bridge"
Creating laradock_mysql_1 ...
Creating laradock_applications_1 ...
Creating laradock_mysql_1
Creating laradock_applications_1 ... done
Creating laradock_workspace_1 ...
Creating laradock_workspace_1 ... done
Creating laradock_php-fpm_1 ...
Creating laradock_php-fpm_1 ... done
Creating laradock_nginx_1 ...
Creating laradock_nginx_1 ... done
> docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
laradock_applications_1 /true Exit 0
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
laradock_php-fpm_1 docker-php-entrypoint php-fpm Up 9000/tcp
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
> docker-compose down
Stopping laradock_nginx_1 ... done
Stopping laradock_php-fpm_1 ... done
Stopping laradock_workspace_1 ... done
Stopping laradock_mysql_1 ... done
Removing laradock_nginx_1 ... done
Removing laradock_php-fpm_1 ... done
Removing laradock_workspace_1 ... done
Removing laradock_mysql_1 ... done
Removing laradock_applications_1 ... done
Removing network laradock_default
Removing network laradock_frontend
Removing network laradock_backend
> docker-compose up -d apache2 mariadb
Creating laradock_applications_1 ...
Creating laradock_mariadb_1 ...
Creating laradock_mariadb_1
Creating laradock_applications_1 ... done
Creating laradock_mariadb_1 ... done
Creating laradock_workspace_1 ... done
Creating laradock_php-fpm_1 ...
Creating laradock_php-fpm_1 ... done
Creating laradock_apache2_1 ...
Creating laradock_apache2_1 ... done
웹 서버가 다르더라도 문제없이 Laravel 화면이 표시됩니다.
phpmyadmin 시작
필요할 때 phpmyadmin을 추가로 시작할 수 있습니다.
> docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
laradock_applications_1 /true Exit 0
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
laradock_php-fpm_1 docker-php-entrypoint php-fpm Up 9000/tcp
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
> docker-compose up -d phpmyadmin
laradock_mysql_1 is up-to-date
Creating laradock_phpmyadmin_1 ...
Creating laradock_phpmyadmin_1 ... done
> docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
laradock_applications_1 /true Exit 0
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
laradock_php-fpm_1 docker-php-entrypoint php-fpm Up 9000/tcp
laradock_phpmyadmin_1 /run.sh phpmyadmin Up 0.0.0.0:8080->80/tcp
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
phpmyadmin URL
http://localhost-8080.com/
Reference
이 문제에 관하여(Laradock on Docker of Windows), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/rex0220/items/2781e260904f8e9f8abf
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
> docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
laradock_applications_1 /true Exit 0
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
laradock_php-fpm_1 docker-php-entrypoint php-fpm Up 9000/tcp
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
> docker-compose up -d phpmyadmin
laradock_mysql_1 is up-to-date
Creating laradock_phpmyadmin_1 ...
Creating laradock_phpmyadmin_1 ... done
> docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
laradock_applications_1 /true Exit 0
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
laradock_php-fpm_1 docker-php-entrypoint php-fpm Up 9000/tcp
laradock_phpmyadmin_1 /run.sh phpmyadmin Up 0.0.0.0:8080->80/tcp
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
Reference
이 문제에 관하여(Laradock on Docker of Windows), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/rex0220/items/2781e260904f8e9f8abf텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)