Skip to content

Development environment for the Sulu content management platform based on docker-compose

License

Notifications You must be signed in to change notification settings

sulu/sulu-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sulu-Docker

Development environment for the Sulu content management platform built with Docker Compose.

Docker is a great tool for trying new technologies effortlessly. Unfortunately, there are still significant filesystem performance issues when using bind mounts on some systems.

If you are experiencing bad performance, we recommend to use dockerized services (MySQL, Elasticsearch) in combination with the Symfony Local Web Server. For example, the Sulu Demo repository includes such a setup.

URLs

  • Sulu-Website: PROJECT_DOMAIN:PORT_NGINX (default: sulu.localhost:18080)
  • Sulu-Admin: PROJECT_DOMAIN:PORT_NGINX/admin (default: sulu.localhost:18080/admin)
  • MySQL: PROJECT_DOMAIN:PORT_MYSQL (default: sulu.localhost:13306)
  • Elasticsearch: PROJECT_DOMAIN:PORT_ELASTICSEARCH (default: sulu.localhost:19200)

Install Environment

git clone https://github.com/sulu/sulu-docker && cd sulu-docker

The .env file contains several environment variables that are used to throughout the environment. This allows to configure the project path, database settings, public ports of the services and the domain name.

To access your project via the configured domain, you need to add it to your /etc/hosts file:

127.0.0.1    sulu.localhost (value of your PROJECT_DOMAIN)

Startup Containers

docker-compose up

You can also startup the containers in the background by executing:

docker-compose start

Create Sulu Project

# Start bash inside of the php container
docker-compose exec php bash

# Create a new sulu project with composer
composer create-project sulu/skeleton /var/www/html

# Set service urls to the `.env.local` file
echo "DATABASE_URL=mysql://$MYSQL_USER:$MYSQL_PASSWORD@mysql:3306/$MYSQL_DATABASE" >> .env.local
echo "ELASTICSEARCH_HOST=elasticsearch:9200" >> .env.local

# Initialize sulu project
bin/adminconsole sulu:build dev --destroy

After completing these steps the services are accessible via the URLs listed above.

Update Container Configuration

When changing configuration inside of the docker folder, the environment must be rebuilt and restarted:

docker-compose down
docker-compose build
docker-compose up

About

Development environment for the Sulu content management platform based on docker-compose

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published