Sign inSign up

msdeploybot/silverstripe-web

By msdeploybot

•Updated almost 8 years ago

SilverStripe Web - Apache + PHP + composer + xdebug for development environments

Image
1

1.3K

msdeploybot/silverstripe-web repository overview

⁠Docker file for Silverstripe projects

This is a Dockerfile for Silverstripe projects using a php:7.2 base, and made available at msdeploybot/silverstripe-web. It has some useful tools installed such as xdebug, sspak, composer. See below for examples on how to set up a SS 3 or SS 4 site.

⁠Create a Silverstripe 4 site locally

You can either use msdeploybot/silverstripe-web, or build the image yourself locally and give it a name to use as the "image" in the .yml below.

$ docker build -t silverstripe-web .
⁠Create a docker-compose.yml
version: '3'
services:
  web:
    image: msdeploybot/silverstripe-web
    working_dir: /var/www
    volumes:
      - .:/var/www
    ports:
      - 8080:80

  database:
    image: mysql
    volumes:
      - db-data:/var/lib/mysql
    restart: always
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=true
      - MYSQL_DATABASE=development

volumes:
  db-data:
⁠Create a .env
# Environment dev or live
SS_ENVIRONMENT_TYPE="dev"
SS_DEFAULT_ADMIN_USERNAME="admin"
SS_DEFAULT_ADMIN_PASSWORD="password"
SS_BASE_URL="http://localhost:8080/"

# DB credentials
SS_DATABASE_CLASS="MySQLPDODatabase"
SS_DATABASE_SERVER="database"
SS_DATABASE_NAME="development"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD=""
$ docker-compose up -d

⁠Create a Silverstripe 3 site

Use the same configuration as above except:

  • The working_dir and volumes in docker-compose.yml should be /var/www/public
  • Environment variables go into a _ss_environment.php file instead

⁠Console access

$ docker-compose exec web /bin/bash

⁠Credits

Tag summary

Content type

Image

Digest

Size

261 MB

Last updated

almost 8 years ago

docker pull msdeploybot/silverstripe-web