Skip to content

Commit

Permalink
Added docker-compose file
Browse files Browse the repository at this point in the history
This file brings all of the third-party and edX services online. Additionally, a directory has been created for shared volumes. A Makefile is included to simplify the starting and stopping of the services.

ECOM-6561
  • Loading branch information
clintonb committed Dec 8, 2016
1 parent 1960e5c commit 7b227ce
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dev/volumes/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains the data for devstack. The contents of this directory are ignored by Git.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ ENV/

# PyCharm
.idea/

.dev/
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.PHONY: devstack.reset devstack.start devstack.stop help

help: ## Display this help message
@echo "Please use \`make <target>' where <target> is one of"
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'

# TODO Print out help for this target. Even better if we can iterate over the services in docker-compose.yml, and
# print the actual service names.
devstack.open.%: ## Open a shell into the specified service container
docker exec -it edx.devstack.$* env TERM=$(TERM) /edx/app/$*/devstack.sh open

devstack.reset: ## Remove all service containers
docker-compose down

devstack.start: ## Start all services
docker-compose up

devstack.stop: ## Stop all services
docker-compose stop
95 changes: 95 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This file contains all of the services for an edX installation. See https://docs.docker.com/compose/compose-file/
# for the appropriate syntax and definitions.
#
# Housekeeping Rules:
# - Group third-party and edX services separately
# - Alphabetize services in the groups
# - Alphabetize individual configuration options for each service
# - Every service's container name should be prefixed with "edx.devstack." to avoid conflicts with other containers
# that might be running for the same service.

version: "2.1"

services:
## Third-party services
elasticsearch:
container_name: edx.devstack.elasticsearch
image: elasticsearch:1.5.2
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ./.dev/volumes/elasticsearch/data:/usr/share/elasticsearch/data
- ./.dev/volumes/elasticsearch/logs:/usr/share/elasticsearch/logs
- ./.dev/volumes/elasticsearch/plugins:/usr/share/elasticsearch/plugins

memcached:
container_name: edx.devstack.memcached
image: memcached:1.4.24
ports:
- "11211:11211"

mysql:
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
container_name: edx.devstack.mysql
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
image: mysql:5.6
ports:
- "3306:3306"
volumes:
- ./.dev/volumes/mysql:/var/lib/mysql

## edX services
credentials:
command: /edx/app/credentials/devstack.sh start
container_name: edx.devstack.credentials
depends_on:
- mysql
- memcached
- discovery
environment:
ENABLE_DJANGO_TOOLBAR: 1
image: edxops/credentials:latest
ports:
- "18150:18150"

discovery:
command: /edx/app/discovery/devstack.sh start
container_name: edx.devstack.discovery
depends_on:
- mysql
- elasticsearch
- memcached
environment:
TEST_ELASTICSEARCH_URL: "http://edx.devstack.elasticsearch:9200"
ENABLE_DJANGO_TOOLBAR: 1
image: edxops/discovery:latest
ports:
- "18381:18381"

ecommerce:
command: /edx/app/ecommerce/devstack.sh start
container_name: edx.devstack.ecommerce
depends_on:
- mysql
- memcached
- discovery
environment:
ENABLE_DJANGO_TOOLBAR: 1
image: edxops/ecommerce:latest
ports:
- "18130:18130"

programs:
command: /edx/app/programs/devstack.sh start
container_name: edx.devstack.programs
depends_on:
- mysql
- memcached
environment:
ENABLE_DJANGO_TOOLBAR: 1
image: edxops/programs:latest
ports:
- "18140:18140"

0 comments on commit 7b227ce

Please sign in to comment.