/silverstripe-docker

Silverstripe startet for Docker with NGINX, PHP, Mailhog, Percona

Primary LanguageDockerfile

Silverstripe 4 starter project with Docker

Repos

Port Map

Service Internal External
Mailhog SMTP 1025
Mailhog Webinterface 8025 8025
MySQL 3306 3306
Nginx 80 80
PHP 9000

Quickstart

$ cp .env.example .env
$ docker-compose build
$ bin/composer install
$ docker-compose up

Open http://localhost with your browser

Usage

Composer

$ bin/composer 

Docker Compose

# Build
$ docker-compose build

# Start
$ docker-compose up

# Stop
$ docker-compose down

Docker Images

# Network
docker network create silverstripe

# PHP
docker run -d --rm \
    --name silverstripe_php \
    --net silverstripe \
    --net-alias php \
    -e PHP_DATE_TIMEZONE=Europe/Berlin \
    -e SS_DATABASE_SERVER=mysql.example.com \
    -e SS_DATABASE_USERNAME=silverstripe \
    -e SS_DATABASE_PASSWORD=silverstripe \
    -e SS_DATABASE_NAME=silverstripe \
    -v /path_to_your_silverstripe_project/:/srv/silverstripe/:rw,cached \
    derdiggn/silverstripe-docker:4-php-latest

# NGINX
docker run -d --rm \
    --name silverstripe_nginx \
    --net silverstripe \
    -p 80:80 \
    -v /path_to_your_silverstripe_project/public/assets:/srv/silverstripe/public/assets:ro \
    derdiggn/silverstripe-docker:4-nginx-latest

Enviroment Variables

Example: https://github.com/derdiggn/silverstripe-docker/blob/master/.env.example

Silverstripe Core

see https://docs.silverstripe.org/en/4/getting_started/environment_management/#core-environment-variables

Custom

PHP

PHP_DATE_TIMEZONE=Europe/Berlin
PHP_POST_MAX_SIZE=6M
PHP_UPLOAD_MAX_FILESIZE=5M

Silvrstripe

SS_SMTP_HOST=mailhog
SS_SMTP_PORT=1025
SS_SMTP_ENCYPTION=
SS_SMTP_USERNAME=
SS_SMTP_PASSWORD=
SS_SMTP_AUTH_MODE=