项目作者: dmasior

项目描述 :
Example PHP app dockerized
高级语言: Dockerfile
项目地址: git://github.com/dmasior/php-docker-skeleton.git
创建时间: 2020-03-18T20:12:24Z
项目社区:https://github.com/dmasior/php-docker-skeleton

开源协议:MIT License

下载


Example PHP app dockerized

This repository shows example usage of Docker in your PHP app.
It solves common problems when working with Docker on dev/prod environments.

  • No more permission denied issues thanks to creating user with same ID as yours
  • No more dev/prod Dockerfiles. Just one Dockerfile per container thanks to using multi-stage builds
  • Easy & simple way to add another container such as redis, db and so on

Dockerfile’s located in .docker and it’s subdirectories.

App is built and pushed through actions
to AWS ECR and then deployed to ECS (Fargate). See .github/workflows/build-and-deploy.yml.

Try it out

1. Clone

  1. $ git clone git@github.com:initx/php-docker-skeleton.git \
  2. && cd php-docker-skeleton

2. Run dev environment

  1. $ docker-compose up -d

3. Dig into app container

  1. $ docker exec -it app_php bash

Tip: it is cool to create alias for entering app container in your .bashrc or .zshrc:

  1. alias app_bash='docker exec -it app_php bash'

4. Install dependencies

  1. $ composer install

5. Visit localhost:8080