LoginSignup
4
2

More than 5 years have passed since last update.

php の slim framework を docker ですぐ使う

Posted at

tl;dr

docker pull composer
composer create-project slim/slim-skeleton sample
cd sample
vi docker-compose.yml
docker-compose up

メモ

  • composer が既にインストールされてる環境なら docker pull composer は不要
  • https://hub.docker.com/_/composer/ にあるとおり、.bashrc に function を書くと便利
  • create-project で生成される docker-compose.yml のcommand: php -S 0.0.0.0:8080 -t public index.php だと動かないので、 command: php -S 0.0.0.0:8080 -t public public/index.php に直す。これは本家のトップページに書いてあるのと同じ(なぜ生成されたdocker-compose.ymlが間違っているんだ。。。?)
  • docker-compose up したら動き出す
4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2