shinsenter/statamic

Sponsored OSS

By SHIN Company

•Updated 3 days ago

šŸ”‹ (PHP / Statamic) Production-ready Docker images with automatic Statamic installer.

Image
Developer tools
Web servers
Content management system
4

100K+

shinsenter/statamic repository overview

⁠shinsenter/statamic

šŸ”‹ (PHP / Statamic) Production-ready Docker images with automatic Statamic installer.

The Docker images are available for both Debian and Alpine versions.

⁠Introduction

Our PHP Docker images, available on Docker Hub⁠, are designed for easy configuration of PHP and PHP-FPM settings via environment variables. This approach eliminates the need to rebuild images when making configuration changes.

These images also come with the latest version of Composer⁠, enabling you to start projects quickly without additional installations.

⁠Usage

shinsenter/php

Check out our documentation⁠ to learn how to customize these Docker images for your projects.

⁠Creating a New Project

When you mount an empty directory into the container, it will automatically download the entire source code for the framework, allowing you to bootstrap a new project quickly.

⁠Steps to Create a New Project
  1. Create an empty directory on your host machine for your project code. For example:
mkdir statamic
  1. Run the container and mount the empty directory as a volume. For example:
docker run -p 80:80 -p 443:443 -p 443:443/udp \
    -v ./statamic:/var/www/html \
    shinsenter/statamic:latest

The container will detect the empty directory mounted to /var/www/html and clone the framework source code into it.

⁠Using an Existing Project

You can mount your application code from your host machine to the /var/www/html directory inside the container.

Because the source code is mounted as a volume, any changes made on the host machine will be reflected inside the container. This setup allows you to run builds, tests, and other tasks within the container while keeping your code on the host.

⁠Using HTTPS

The Docker images come with pre-generated SSL certificate files for testing HTTPS locally:

  • /etc/ssl/site/server.crt
  • /etc/ssl/site/server.key

To use valid HTTPS certificates for your production website, replace these files with your own valid SSL certificates. You can do this by copying or mounting your certificates from the host machine into the container. Simply overwrite the default certificate files with your valid certificate and key files to enable true HTTPS for your production website.

⁠Using Dockerfile
FROM shinsenter/statamic:latest

# Copy your own certs into the container
COPY my_domain.crt /etc/ssl/site/server.crt
COPY my_domain.key /etc/ssl/site/server.key

# Add your instructions here
# For example:
# ADD --chown=$APP_USER:$APP_GROUP ./statamic/ /var/www/html/
⁠Using docker run
docker run -p 80:80 -p 443:443 -p 443:443/udp \
    -v ./statamic:/var/www/html \
    -v ./my_domain.crt:/etc/ssl/site/server.crt \
    -v ./my_domain.key:/etc/ssl/site/server.key \
    shinsenter/statamic:latest
⁠Using docker-compose
services:
  web:
    image: shinsenter/statamic:latest
    volumes:
      - ./statamic:/var/www/html
      - ./my_domain.crt:/etc/ssl/site/server.crt
      - ./my_domain.key:/etc/ssl/site/server.key

⁠Environment variables

You can optionally set the following environment variables in the container to enable certain services to run alongside the web server.

šŸ“ Note: you'll need to install the required packages and create the necessary configs yourself for features like Laravel Pulse, Laravel Horizon or Laravel Reverb.

Environment VariableDescription
LARAVEL_AUTO_MIGRATIONWhether to automatically run database migrations when the app boots. Set to 0 to disable running migration. Default is 1.
LARAVEL_AUTO_MIGRATION_OPTIONSAdditional options/flags to pass to the artisan migrate command (e.g. --seed).
LARAVEL_ENABLE_QUEUE_WORKEREnables supervisor service for the Laravel queue worker. Set to 1 to start processing jobs. Default is 0.
LARAVEL_QUEUE_WORKER_OPTIONSDefines custom options for the Laravel queue worker (e.g., connection, delay).
LARAVEL_ENABLE_SCHEDULEREnables supervisor service for the Laravel scheduler. Set to 0 to disable running scheduled tasks. Default is 1.
LARAVEL_SCHEDULER_OPTIONSSpecifies additional options for the scheduler execution.
LARAVEL_ENABLE_HORIZONEnables supervisor service for Laravel Horizon, a dashboard for managing queues. Default is 0.
LARAVEL_HORIZON_OPTIONSOptions for customizing Laravel Horizon behavior (e.g., environment, queue names).
LARAVEL_ENABLE_PULSEEnables supervisor service for Laravel Pulse for application performance monitoring. Default is 0.
LARAVEL_PULSE_OPTIONSConfiguration options for Laravel Pulse (e.g., port, storage).
LARAVEL_ENABLE_REVERBEnables supervisor service for Laravel Reverb for real-time WebSocket communication. Default is 0.
LARAVEL_REVERB_OPTIONSConfiguration options for Laravel Reverb (e.g., port, storage).

⁠Stable Image Tags

The release versions on this GitHub repository⁠ don't guarantee that Docker images built from the same source code will always be identical.

We build new Docker images daily to ensure they stay up-to-date with the latest upstream updates for PHP, base OS, Composer, etc. The images in this repo are regularly updated under the same tag names.

But you can pull the image from shinsenter/statamic:latest, and tag it with a name that indicates its stability, such as your-repo/statamic:stable using the below commands:

docker pull shinsenter/statamic:latest
docker tag  shinsenter/statamic:latest your-repo/statamic:stable
docker push your-repo/statamic:stable

Then use the image your-repo/statamic:stable as a base image to build containers for production.

⁠Contributing

If you find these images useful, consider donating via PayPal⁠ or opening an issue on GitHub⁠.

Your support helps maintain and improve these images for the community.

⁠License

This project is licensed under the terms of the GNU General Public License v3.0⁠.

Thank you for recognizing the intellectual effort behind this project. If you plan to use or build upon any of its ideas, I kindly ask that you give appropriate credit.


From Vietnam šŸ‡»šŸ‡³ with love.

Tag summary

Content type

Image

Digest

sha256:c6244308f…

Size

104.5 MB

Last updated

3 days ago

docker pull shinsenter/statamic:dev-php8.4

This week's pulls

Pulls:

7,503

Last week