ucan-lab / docker-laravel Goto Github PK
View Code? Open in Web Editor NEW🐳 Build a simple laravel development environment with Docker Compose.
License: MIT License
🐳 Build a simple laravel development environment with Docker Compose.
License: MIT License
MIT Licence
$ docker-compose build
...
+ apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Err:1 http://security.debian.org/debian-security buster/updates InRelease
At least one invalid signature was encountered.
Err:2 http://deb.debian.org/debian buster InRelease
At least one invalid signature was encountered.
Err:3 http://deb.debian.org/debian buster-updates InRelease
At least one invalid signature was encountered.
Reading package lists...
W: GPG error: http://security.debian.org/debian-security buster/updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://security.debian.org/debian-security buster/updates InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian buster InRelease: At least one invalid signature was encountered.
E: The repository 'http://deb.debian.org/debian buster InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian buster-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://deb.debian.org/debian buster-updates InRelease' is not signed.
Removing intermediate container c12d9ca46d6e
Upgrade to the latest stable version 1.18 released
services:
app:
build: ./infra/docker/php
services:
app:
build:
context: .
dockerfile: ./infra/docker/php/Dockerfile
By putting the root directory in the Docker context, the Dockerfile will be able to access any file.
To have many people use it
ENV LOG_CHANNEL=stderr
I want a minimal configuration !
npm-install:
docker-compose exec web npm install
npm-dev:
docker-compose exec web npm run dev
npm-watch:
docker-compose exec web npm run watch
npm-watch-poll:
docker-compose exec web npm run watch-poll
npm-hot:
docker-compose exec web npm run hot
Simpler configuration
docker/php/bash/psysh
docker/php/bash/.bash_history
Change the generated path of the cache file to /tmp
$ php artisan clear-compiled
$ composer dump-autoload
bootstrap/cache/services.php
bootstrap/cache/packages.php
$ php artisan config:clear
$ php artisan config:cache
bootstrap/cache/config.php
$ php artisan route:clear
$ php artisan route:cache
bootstrap/cache/routes.php
$ php artisan event:clear
$ php artisan event:cache
bootstrap/cache/events.php
$ php artisan view:clear
$ php artisan cache:clear
APP_SERVICES_CACHE=/tmp/cache/services.php
APP_PACKAGES_CACHE=/tmp/cache/packages.php
APP_CONFIG_CACHE=/tmp/cache/config.php
APP_ROUTES_CACHE=/tmp/cache/routes.php
APP_EVENTS_CACHE=/tmp/cache/events.php
VIEW_COMPILED_PATH=/tmp/cache/views
SESSION_DRIVER=cookie
LOG_CHANNEL=stderr
Lock version before Composer version 2 is released and stuck
install-development-packages
to install-recommend-packages
Make it easier to understand
.
├── infrastructure
│ ├── .env
│ ├── .gitignore
│ ├── Makefile
│ ├── docker
│ │ ├── mysql
│ │ ├── nginx
│ │ └── php
│ └── docker-compose.yml
.
├── infra
│ ├── .gitignore
│ └── docker
│ ├── mysql
│ ├── nginx
│ └── php
├── Makefile
└── docker-compose.yml
.env
Not requiredinfrastructure
=> infra
Simple nameMakefile
Can be run in the project root directoryMeasures for those who have MySQL installed in the local environment of Mac.
ElasticSearchのオプションもあったら素敵かな、と。
方針にそぐわないならcloseしちゃってください。
version: "3.8"
I want a minimal configuration !
Dockerfile.production
file required--seed
option to make fresh
commandmake rollback-test
commandnpm
command to web
containerすみません。PHPの初心者で学習中の者です。こちらのqiitaで大変勉強になりいつも有難う御座います。
ただ今貴方様のこちらのDocker-laravelのファイルを参考にして独学でPHPを勉強しようと, macにphp7.4-fpm-buster+nginx+mysql8+phpmyadmin/phpmyadminで構築して”いちばんやさしいPHPの教本”を勉強しました。
他の目的に近い参考にしたサイトです。
https://php-archive.net/php/docker-php-environment/
https://qiita.com/nemui_/items/f911be7ffa4f29293fd5, etc..
殆どのサイト通りは全く構築出来ませんでしたが貴方様のDocker-laravelのphpの設定Dockerfileで構築出来ました。深く感謝したします。
前書き長く申し訳ありません。以前数週間前の貴方様のphpの設定ファイルのDockerfileの記述で、
PHP のDockerfile構成
FROM php:7.4-fpm-buster
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]
ENV TZ=UTC \
# locale
LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 \
# composer environment
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN apt-get update && \
apt-get -y install git libicu-dev libonig-dev libzip-dev unzip locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
locale-gen en_US.UTF-8 && \
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
mkdir /var/run/php-fpm && \
mkdir(--こちらに書いてあった記述を教えて下さい--)
docker-php-ext-install intl pdo_mysql mbstring zip bcmath && \
composer config -g process-timeout 3600 && \
composer config -g repos.packagist composer https://packagist.jp && \
composer global require hirak/prestissimo
COPY php.ini /usr/local/etc/php/
**以前に
mkdir /var/run/php-fpm && \
の下にもう一つ
`mkdir ~~`
の記述で稼動できました。**
こちらの記述を覚えていらっしゃいますか??お忙しいところ恐れ入りますが何卒よろしく御願い致します。m(_ _)m
佐藤秀人
Ride the flow of the times...
環境構築に利用させて頂いてます。ありがとうございます。
利用していたところ、Laravel側でURLクエリが取得できませんでした。
https://github.com/ucan-lab/docker-laravel/blob/master/infrastructure/docker/nginx/default.conf#L13
↑ 以下に変更すればうまく動きましたー
try_files $uri $uri/ /index.php?$query_string
Because it's easy to type
❯ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
ややレアな環境だとは思うのですが、以下のコンソール出力で make install-recommend-packages
が失敗します
❯ sudo make install-recommend-packages
docker-compose exec app composer require doctrine/dbal
Using version ^3.0 for doctrine/dbal
./composer.json has been updated
Running composer update doctrine/dbal
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- barryvdh/laravel-ide-helper is locked to version v2.8.2 and an update of this package was not requested.
- barryvdh/laravel-ide-helper v2.8.2 requires doctrine/dbal ~2.3 -> found doctrine/dbal[2.3.0-BETA1, ..., 2.12.x-dev] but it conflicts with your root composer.json require (^3.0).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
make: *** [install-recommend-packages] エラー 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.