Git Product home page Git Product logo

ss-docker-compose's Introduction

SilverStripe 4 docker development environment

Docker based development environment for SilverStripe 4 applications Can be used on multiple environments at the same time.

Maintainer Contact

Requirements

Install

To install globally run:

composer global require brettt89/ss4-docker-compose

Make sure your ~/.composer/vendor/bin directory is in your PATH.

echo 'export PATH=$PATH:~/.composer/vendor/bin/' >> ~/.bash_profile

Then you can run this script with docker-ss <docker-compose command> in your project root.

How to use

docker-ss in a nutshell is basically a wrapper for docker-compose with some added functionality and checks. all docker-compose commands should run as expected via docker-ss

Environment file

Ensure you have an environment file setup in your project root with the following settings.

# DB credentials
SS_DATABASE_CLASS = "MySQLPDODatabase"
SS_DATABASE_SERVER = "database"
SS_DATABASE_USERNAME = "root"
SS_DATABASE_PASSWORD = ""
SS_DATABASE_NAME = "SS_mysite"

Start services

docker-ss up -d

By default, this setup will create 2 containers per project and 1 global nginx proxy (ss-proxy).

Containers:

  • web (web server)
    • Hostname: {folder_name}.local
  • database (database server)
    • Hostname: {folder_name}.db.local

NOTE: In order to access the servers by hostname you will need to map these domains to your "Hosts" IP.

E.g. File: /etc/hosts, ({folder_name} = "./ss4")

127.0.0.1	ss4.local ss4.db.local

Advanced usage

The docker-compose executable included in this package does some additional checks and configuration with commands. This should always be used over the native docker-compose function.

However all docker-compose commands can be used via this package as per usual.

Running dev/build.

docker-ss exec web ./vendor/bin/sake dev/build

SSH into web server (Bash terminal).

docker-ss ssh

Accessing database from client

Host: {folder_name}.db.local
Port: 3306
Database: SS_mysite
Username: root
Password: <empty>

ss-docker-compose's People

Contributors

brettt89 avatar mossman1215 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.