https://github.com/dynamic/silverstripe-docker
https://github.com/dynamic/silverstripe-docker
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dynamic/silverstripe-docker
- Owner: dynamic
- Created: 2017-09-11T20:32:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-08T18:22:40.000Z (almost 2 years ago)
- Last Synced: 2025-02-09T20:26:01.244Z (5 months ago)
- Language: Dockerfile
- Size: 39.1 KB
- Stars: 1
- Watchers: 7
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Container for Silverstripe Development
A server equiped with apache and PHP 8.2. Intended to be used with [docker-compose](http://github.com/dynamic/silverstripe-docker-compose) and a MySQL container.
## Requirements
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
## Usage
Below, subsititue `yourproject` with the name of your project.
### Docker Compose
Create a `docker-compose.yml` file in your project root:
```
version: '3'
services:
web:
image: dynamicagency/silverstripe-docker
working_dir: /var/www
ports:
- 8080:80
volumes:
- .:/var/www
- ./public:/var/www/htmldatabase:
image: mysql
volumes:
- db-data:/var/lib/mysql
restart: always
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=truevolumes:
db-data:
```In terminal, bring the Docker containers up:
`docker-compose up -d`
### Setup Your Environment
For Silverstripe projects:
```
# DB credentials
SS_DATABASE_SERVER="database"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD=""
SS_DATABASE_NAME="yourproject"
SS_BASE_URL="http://localhost:8080/"
```In your browser, navigate to localhost port `8080`
`http://localhost:8080`
### SSH Access
Get the project name:
`docker ps`
Connect to the web container:
`docker exec -it yourproject-web-1 bash`
### Database access via SSH
`mysql -u root -h database yourproject`
### Stop a Machine
`docker-compose stop` or
`docker-machine stop yourproject`