Skip to content

Commit

Permalink
Improved docs & examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shinsenter committed Jan 30, 2023
1 parent b3b3f55 commit 228b5db
Show file tree
Hide file tree
Showing 35 changed files with 461 additions and 441 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog


## 3.0.0 - 2023-01-30

- Disabled auto-optimize, removed `vendor:publish` in Laravel base project scripts.
- Improved docs & examples.


## 2.5.0 - 2023-01-19

Use [S6 Overlay v3.1.3.0](https://github.com/just-containers/s6-overlay/releases/tag/v3.1.3.0).
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Contributions
# Let's Make a Difference Together!

## Interested in contributing?
## Ready to Join the Open Source Community?

As an open source project, we'd appreciate any help and contributions!
As a thriving open source project, we welcome all contributions and support from our community. Let's make this project even better together!

We follow the standard [github pull request process](https://help.github.com/articles/about-pull-requests). We'll try to review your contributions as soon as possible.
We follow the standard [github pull request process](https://help.github.com/articles/about-pull-requests), and we will review your contributions promptly.

## File an Issue
## Spot Something that Needs Improvement?

Not ready to contribute code, but see something that needs work? While we encourage everyone to contribute code, it is also appreciated when someone reports an issue. We use [github issues](https://github.com/shinsenter/php/issues) for this.
Not comfortable contributing code just yet? No problem! We appreciate when someone reports an issue that needs attention. Simply create a [github issue](https://github.com/shinsenter/php/issues) and we'll take it from there.

From contributing to source code to improving readability of the documentation, all suggestions are welcome!
From source code contributions to enhancing the readability of the documentation, every idea and suggestion counts! Let's build a better project together.
57 changes: 28 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,36 @@

## About this project

I have had those concerns when building environments for PHP applications.
Are you tired of the tedious and time-consuming process of building environments for your PHP applications? I know I was.

- Tired of waiting around for Docker images to build.
- Tired of customizing modules from official Docker PHP images, and Docker image after installing more modules becomes too big.
- Tired of installing web server like Apache or Nginx on the top of PHP, in order to run a PHP application on browser.
From waiting for Docker images to build, to customizing modules on official Docker PHP images and dealing with bloated images after installing more modules, to installing web servers like Apache or Nginx on top of PHP just to run an application on a browser - it's all too much.

Above jobs are quite boring and time consuming, am I right?
With my many years of experience in the field, I've created this project to help you easily and quickly set up an environment for your PHP applications, whether it's for production or development. Say goodbye to the tedious tasks and hello to a streamlined process.

Therefore, based on my many years of experience, I created this project to help you quickly build an environment to run your PHP applications (regardless of whether it is a production or development environment).
I hope you find this project helpful. If you do, please consider supporting my work by visiting [this section](https://code.shin.company/php/blob/main/SPONSOR.md).

I hope you find this project helpful, please consider [supporting my works](https://code.shin.company/php/blob/main/SPONSOR.md) if you like it.

> ### Special thanks
> ### Thanks
>
> This project is inspired by the [serversideup/docker-php](https://github.com/serversideup/docker-php) project, I love it.
> This project was inspired by the [serversideup/docker-php](https://github.com/serversideup/docker-php) project, which I appreciate.
>
> However the owners seem to be quite busy updating their projects, so I made my own version.
> However, as the original authors seemed to be occupied with other updates, I decided to create our own version.
Let's check it out!

## Container OS

This project is built on top of my Docker base image, which is Ubuntu 22.04 (Jammy) with [s6-overlay v3](https://docker.shin.company/s6-overlay) and OpenSSL included.
These Docker images include the latest version of Ubuntu 22.04 (Jammy) and are packed with powerful tools such as [s6-overlay v3](https://docker.shin.company/s6-overlay) and OpenSSL.

> The s6-overlay, designed specifically for the lifecycle of containers, provides a more accurate way of bringing them down and monitoring their health, while OpenSSL adds an extra layer of security to your containers.
> Learn more:
> - [![`shinsenter/s6-overlay`](https://img.shields.io/docker/image-size/shinsenter/s6-overlay/latest?label=shinsenter%2Fs6-overlay)](https://docker.shin.company/s6-overlay)
> - [![`shinsenter/s6-ubuntu`](https://img.shields.io/docker/image-size/shinsenter/s6-ubuntu/latest?label=shinsenter%2Fs6-ubuntu)](https://docker.shin.company/s6-ubuntu)
## Available images

These images are actively maintained.
These Docker images are continuously updated to provide you with the most cutting-edge technology in the container world.

Let's check it out!

### PHP versions

Expand Down Expand Up @@ -127,17 +126,13 @@ docker pull shinsenter/php:${PHP_VERSION}-${PHP_VARIATION}
### The document root

You can choose your own path for the document root by using the environment variable `$WEBHOME`.
By default, your application will be placed in the `/var/www/html` directory of the Docker container, also known as the document root. However, if you want to change the location of your application, you can simply adjust the `WEBHOME` environment variable.

```Dockerfile
ENV WEBHOME="/var/www/html"
```

> The default document root is set to `/var/www/html`, and your application must be copied or mounted to this path.
> Sometimes you may wish to change the default document root (away from `/var/www/html`), please consider changing the `$WEBHOME` value.
After changing the `$WEBHOME` variable, you also have to change your default working directory by adding these lines to the bottom of your `Dockerfile`:
But don't forget, after changing this variable, you'll also need to update your default working directory in the Dockerfile. No worries, it's easy to do! Just add a couple of lines to the bottom of your Dockerfile and you're good to go:

```
# sets the working directory
Expand Down Expand Up @@ -221,11 +216,15 @@ For example:
docker run --rm -v $(pwd):/var/www/html -e PUID=$(id -u) -e PGID=$(id -g) shinsenter/php:8.2-cli composer create-project laravel/laravel /var/www/html
```

## Customize Docker image
## Customize Your Docker Image

Easily change container configurations and tailor your image to your specific needs by utilizing pre-defined Docker environment variables.

Look no further than this `Dockerfile` sample for building your own custom image by extending the base image provided here.

Here below is a sample `Dockerfile` for building your own Docker image extending one of above images. You also can change below pre-defined Docker's ENV lines to change PHP-FPM behavior without copying configuration files to your containers.
> Want to learn more about how to create the ultimate custom image? Check out the [Dockerfile documentation](https://docs.docker.com/engine/reference/builder) and start building today.
> Learn more about [Dockerfile](https://docs.docker.com/engine/reference/builder).
But that's not all - you can also add more [pre-defined Docker environment variables](https://code.shin.company/php#customize-docker-image) to change PHP-FPM behavior without copying configuration files to your containers.

```Dockerfile
# change the PHP_VERSION and PHP_VARIATION as your need
Expand Down Expand Up @@ -377,19 +376,19 @@ services:
PUID: ${UID:-9999}
PGID: ${GID:-9999}
links:
- mysql
- db
- redis

## OTHER CONTAINERS SUCH AS REDIS OR MYSQL ###################################
mysql:
image: mysql:latest
## OTHER CONTAINERS SUCH AS REDIS OR DATABASE ###################################
db:
image: mariadb:latest
environment:
TZ: UTC
MYSQL_ROOT_PASSWORD: mydb_p@ssw0rd
MYSQL_DATABASE: my_database
volumes:
- "./mysql/data:/var/lib/mysql"
- "./mysql/dump:/docker-entrypoint-initdb.d"
- "./db/data:/var/lib/mysql"
- "./db/dump:/docker-entrypoint-initdb.d"
ports:
- "3306:3306"
redis:
Expand Down
27 changes: 12 additions & 15 deletions SPONSOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,29 @@

* * *

## Community
## Be a part of our community

As an open-source project, we'd appreciate any help and contributions!
As an open-source project, we rely on the support and contributions of our community to continue improving and expanding our capabilities. By joining our community, you will have the opportunity to:

[![Become a stargazer](https://img.shields.io/badge/Become-Stargazer-yellow)](https://code.shin.company/php/stargazers) [![Report an issue](https://img.shields.io/badge/New-Discussions-green)](https://code.shin.company/php/discussions/new) [![Join us on Gitter](https://badges.gitter.im/shinsenter/php.svg)](https://gitter.im/shinsenter/php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join us on Discord](https://img.shields.io/discord/962919929307357234?color=blueviolet)](https://discord.com/channels/962919929307357234/962920416559652924)
- [![Become a stargazer](https://img.shields.io/badge/Become-Stargazer-yellow)](https://code.shin.company/php/stargazers) and show your support for the project
- [![Report an issue](https://img.shields.io/badge/New-Discussions-green)](https://code.shin.company/php/discussions/new) and help us identify areas for improvement
- [![Join us on Gitter](https://badges.gitter.im/shinsenter/php.svg)](https://gitter.im/shinsenter/php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) or [![Discord](https://img.shields.io/discord/962919929307357234?color=blueviolet)](https://discord.com/channels/962919929307357234/962920416559652924) and connect with other community members

We should follow the standard [Github pull request process](https://help.github.com/articles/about-pull-requests). I'll try to review your contributions as soon as possible.
If you're interested in contributing to the project, we follow the standard [Github pull request process](https://help.github.com/articles/about-pull-requests) and will review your contributions as soon as possible. Even if you're not ready to contribute code, suggestions for improving the documentation or readability are always welcome.


It is also appreciated when you [report an issue](https://code.shin.company/php/issues/new/choose) or [open a discussion](https://code.shin.company/php/discussions/new).

Not ready to contribute code, but see something that needs work? From contributing to source code to improving the readability of the documentation, all suggestions are welcome!

> [NEED HELP] Please help me [improve the documentation and examples](https://code.shin.company/php/edit/main/README.md).
> [NEED HELP] Let's work together to [improve the documentation and examples](https://code.shin.company/php/edit/main/README.md).
* * *

## Support my activities

If you like this repository, please [become a stargazer](https://code.shin.company/php/stargazers) on my Github or join Gitter to follow further updates.

I also love to have your help, please consider [buying me a coffee](https://www.paypal.me/shinsenter), or sponsoring my work so I can create more helpful pieces of stuff 😉.
If you find value in this repository, please consider taking the following actions to support my ongoing development efforts:

[![Donate via PayPal](https://img.shields.io/badge/Donate-Paypal-blue)](https://www.paypal.me/shinsenter) [![Become a sponsor](https://img.shields.io/badge/Donate-Patreon-orange)](https://www.patreon.com/appseeds)
- [Become a stargazer](https://code.shin.company/php/stargazers) on Github.
- [Buy me a coffee](https://www.paypal.me/shinsenter) to fuel my coding sessions.
- [![Become a sponsor](https://img.shields.io/badge/Donate-Patreon-orange)](https://www.patreon.com/appseeds) or [![Donate via PayPal](https://img.shields.io/badge/Donate-Paypal-blue)](https://www.paypal.me/shinsenter) and help me create even more helpful resources.

I appreciate your love and support.
Your support is greatly appreciated and will help me continue to improve and expand upon this project.

* * *

Expand Down
8 changes: 3 additions & 5 deletions src/base-s6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@

## About this project

The images in this repository contain only unpacked [s6-overlay v3](https://github.com/just-containers/s6-overlay) as a multi-platform and reusable build stage.
Are you tired of using clunky and outdated init systems for your containers? Look no further than this repository, where you'll find images containing only the latest version of [s6-overlay v3](https://github.com/just-containers/s6-overlay). This powerful tool was built specifically for the lifecycle of containers, giving you a more accurate way of bringing containers down and monitoring their health.

The s6-overlay was built specifically for the lifecycle of containers, giving you a more accurate way of bringing containers down and monitoring their health.

These images are actively maintained.
But that's not all - these images are actively maintained, ensuring that you're always using the most up-to-date version of s6-overlay. Upgrade your Docker containers with ease.

## Usage

This repository is not intended to be used directly, but rather consumed in other Dockerfiles as a multi-platform and reusable build stage.
This repository is not just a one-trick pony - it's intended to be used as a multi-platform and reusable build stage in other Dockerfiles.

```Dockerfile
FROM ubuntu:latest
Expand Down
18 changes: 9 additions & 9 deletions src/base-ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

## About this project

Latest stable [Ubuntu](https://ubuntu.com) docker base images with [s6-overlay v3](https://github.com/just-containers/s6-overlay/tree/v3) and [OpenSSL](https://github.com/openssl/openssl) included.
Are you tired of using the same old, basic Docker base images? Look no further than this repository, where you'll find the latest stable versions of [Ubuntu](https://ubuntu.com) with added features for optimal container management. Not only do these images include the powerful [s6-overlay v3](https://github.com/just-containers/s6-overlay/tree/v3), specifically designed for the lifecycle of containers, but they also come with [OpenSSL](https://github.com/openssl/openssl) included.

> The [s6-overlay](https://github.com/just-containers/s6-overlay) was built specifically for the lifecycle of containers, giving you a more accurate way of bringing containers down and monitoring their health. See a great explanation called ["The Docker Way?"](https://github.com/just-containers/s6-overlay#the-docker-way) by the s6-overlay team for an excellent explaination.
Want to know more about why s6-overlay is the ultimate tool for container management? Check out the [explanation](https://github.com/just-containers/s6-overlay#the-docker-way) by the s6-overlay team.

These images are actively maintained.
And the best part? These images are actively maintained, ensuring that you're always using the most up-to-date version. Upgrade your Docker containers with ease.

## Container OS

The following versions of Ubuntu are being actively updated:
Stay ahead of the game by using the following versions of Ubuntu Docker images that are actively being updated:

- [22.04](https://docker.shin.company/s6-ubuntu/tags?name=22.04) ([Jammy](https://docker.shin.company/s6-ubuntu/tags?name=jammy), [latest](https://docker.shin.company/s6-ubuntu/tags?name=latest))
- [20.04](https://docker.shin.company/s6-ubuntu/tags?name=20.04) ([Focal](https://docker.shin.company/s6-ubuntu/tags?name=focal))
Expand Down Expand Up @@ -65,13 +65,13 @@ For example:
docker run --rm -v $(pwd):/var/www/html -e PUID=$(id -u) -e PGID=$(id -g) shinsenter/s6-ubuntu env
```

## Customize Docker image
## Customize Your Docker Image

Here below is a sample `Dockerfile` for building your own Docker image extending this image. You also can add more [pre-defined Docker's ENV settings](https://code.shin.company/php#customize-docker-image) to change PHP-FPM behavior without copying configuration files to your containers.
Easily change container configurations and tailor your image to your specific needs by utilizing pre-defined Docker environment variables.

> Learn more about [Dockerfile](https://docs.docker.com/engine/reference/builder).
Look no further than this `Dockerfile` sample for building your own custom image by extending the base image provided here.

You can easily change container configurations by using pre-defined Docker's environment variables.
> Want to learn more about how to create the ultimate custom image? Check out the [Dockerfile documentation](https://docs.docker.com/engine/reference/builder) and start building today.
```Dockerfile
FROM shinsenter/s6-ubuntu
Expand Down Expand Up @@ -106,7 +106,7 @@ Create an empty directory for a new project and place in the directory a `docker
```yml
version: '3'
services:
my-container:
s6-ubuntu-app:
image: shinsenter/s6-ubuntu:latest
environment:
TZ: UTC
Expand Down
2 changes: 1 addition & 1 deletion src/base-ubuntu/root/usr/bin/apt-update
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
exec apt-get update -y "$@"
exec apt-get update -y --no-install-recommends --no-install-suggests "$@"
2 changes: 1 addition & 1 deletion src/base-ubuntu/root/usr/bin/apt-upgrade
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
exec apt-get upgrade -yq "$@"
exec apt-get full-upgrade -yq --no-install-recommends --no-install-suggests "$@"
4 changes: 2 additions & 2 deletions src/base-ubuntu/root/usr/bin/disable
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
service $1 stop 2>/dev/null
update-rc.d $1 disable 2>/dev/null
service "$1" stop 2>/dev/null
update-rc.d "$1" disable 2>/dev/null
2 changes: 1 addition & 1 deletion src/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This image solves for is such a corner case that most people wouldn't run into i

The problem arises when you are trying to build an image for another machine architecture, and have to use `FROM scratch` in your dockerfile, in which case the resulting image will be tagged as being for the build machine's architecture instead of the target architecture (even though Qemu was used).

These images are actively maintained.
These Docker images are continuously updated to provide you with the most cutting-edge technology in the container world.

## Usage

Expand Down
Loading

0 comments on commit 228b5db

Please sign in to comment.