Commit faef3acd by Edward Zarecor

Merge pull request #2344 from edx/e0d/compose-structure

rough structure of docker config in the repo, not yet fully working
parents 003923ed 933cb052
FROM edxops/precise-common:v2
MAINTAINER edxops
USER docker
WORKDIR /edx/app/edx_ansible/edx_ansible
RUN sudo git fetch --all
RUN sudo git checkout e0d/docker-latest
RUN sudo git reset --hard origin/e0d/docker-latest
RUN sudo git pull
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
RUN sudo ansible-playbook edxapp.yml -c local -e "EDXAPP_PYTHON_SANDBOX=false"
USER root
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
EXPOSE 18000 48000 18020 18010 48010 8010 8000
FROM edxops/precise-common:v1
MAINTAINER e0d
USER docker
WORKDIR /edx/app/edx_ansible
ADD inventory /etc/ansible/hosts
WORKDIR /edx/app/edx_ansible/edx_ansible/playbooks/edx-east
RUN sudo git checkout e0d/docker-latest
RUN sudo git reset --hard origin/e0d/docker-latest
RUN sudo git pull
RUN sudo ansible-playbook elasticsearch-docker.yml -c local
USER root
WORKDIR /etc/elasticsearch
CMD ["/usr/share/elasticsearch/bin/elasticsearch"]
EXPOSE 9200 9300
FROM edxops/precise-common:v2
MAINTAINER edxops
USER docker
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
RUN sudo ansible-playbook forum.yml -c local
USER root
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
#ENTRYPOINT ["/bin/bash"]
EXPOSE 18080
FROM edxops/precise-common:v2
MAINTAINER e0d
USER docker
WORKDIR /edx/app/edx_ansible
ENV PATH /tmp/ansible/bin:/bin:/sbin:/usr/sbin:/usr/bin
#ENV ANSIBLE_LIBRARY /edx/app/edx_ansible/edx_ansible/playbooks/library
#ENV PYTHONPATH /tmp/ansible/lib:$PYTHON_PATH
ADD inventory /etc/ansible/hosts
WORKDIR /edx/app/edx_ansible/edx_ansible/playbooks/edx-east
RUN sudo git fetch --all
RUN sudo git checkout e0d/docker
RUN sudo ansible-playbook insights.yml -c local
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord -n --configuration /edx/app/supervisor/supervisord.conf"]
EXPOSE 22 443 80
FROM edxops/precise-common:v1
MAINTAINER edxops
USER docker
WORKDIR /edx/app/edx_ansible/edx_ansible
RUN sudo git fetch --all
RUN sudo git checkout e0d/docker-latest
RUN sudo git reset --hard origin/e0d/docker-latest
RUN sudo git pull
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
RUN sudo ansible-playbook nginx.yml -c local \
-e@roles/edxapp/defaults/main.yml \
-e@roles/xqueue/defaults/main.yml \
-e@roles/ora/defaults/main.yml \
-e@roles/certs/defaults/main.yml
USER root
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
WORKDIR /etc/nginx
CMD ["/usr/sbin/nginx"]
EXPOSE 18000 48000 18010 48010 18020
FROM ubuntu:precise
MAINTAINER e0d
RUN apt-get update
RUN apt-get -y install sudo
RUN useradd docker && echo "docker:docker" | chpasswd
RUN echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN mkdir -p /home/docker && chown -R docker:docker /home/docker
RUN apt-get install -y python2.7 python2.7-dev python-pip python-apt python-yaml python-jinja2 git
USER docker
RUN echo "cachebust"
# bootstrap
RUN sudo git clone --recursive https://github.com/edx/ansible /tmp/ansible
WORKDIR /tmp/ansible
ENV PATH /tmp/ansible/bin:/bin:/sbin:/usr/sbin:/usr/bin
# Install the configuration repository to install
# edx-ansible role
RUN sudo git clone http://github.com/edx/configuration.git /tmp/configuration
ADD inventory /etc/ansible/hosts
WORKDIR /tmp/configuration
RUN sudo git checkout e0d/sever-aws-deps
RUN sudo pip install -r pre-requirements.txt
RUN sudo pip install -r requirements.txt
WORKDIR /tmp/configuration/playbooks/edx-east
RUN sudo /tmp/ansible/bin/ansible-playbook edx_ansible.yml -c local -e "configuration_version=e0d/sever-aws-deps"
# cleanup
RUN sudo rm -rf /tmp/ansible
RUN sudo rm -rf /tmp/configuration
FROM edxops/precise-common:v2
MAINTAINER edxops
USER docker
WORKDIR /edx/app/edx_ansible/edx_ansible
RUN sudo git fetch --all
RUN sudo git checkout e0d/docker-latest
RUN sudo git reset --hard origin/e0d/docker-latest
RUN sudo git pull
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
RUN echo "bust-cache"
RUN sudo ansible-playbook xqueue.yml -c local
USER root
COPY ./docker-run.sh /
ENTRYPOINT ["/docker-run.sh"]
EXPOSE 18040 8040
#!/bin/bash
set -e
/usr/sbin/rsyslogd
/edx/app/supervisor/venvs/supervisor/bin/supervisord --nodaemon --configuration /edx/app/supervisor/supervisord.conf
db:
image: mysql:5.6
environment:
- MYSQL_ROOT_PASSWORD=mypassword
- DNSDOCK_NAME=db1
- DNSDOCK_IMAGE=db
mongo:
image: mongo:2.6
volumes:
- /var/devstack/mongo/data:/data
es:
build: ../build/elasticsearch
image: edxops/elasticsearch:v1
volumes:
- /tmp/elasticsearch/data:/es-data
memcache:
image: memcached:1.4.24
forums:
build: ../build/forums
image: edxops/forums:v2
volumes:
- /home/edward/Documents/git/edx/configuration:/configuration
nginx:
build: ../build/nginx
rabbitmq:
image: rabbitmq:3.5.3
xqueue:
build: ../build/xqueue
environment:
- DNSDOCK_IMAGE=xqueue
edxapp:
build: ../build/edxapp
/home/edward/Documents/git/edx/configuration/playbooks/ansible.cfg
\ No newline at end of file
- name: Deploy edxapp
hosts: all
sudo: True
gather_facts: True
vars:
serial_count: 1
serial: "{{ serial_count }}"
roles:
- docker
- edxapp
- role: datadog
when: COMMON_ENABLE_DATADOG
- role: splunkforwarder
when: COMMON_ENABLE_SPLUNKFORWARDER
- role: newrelic
NEWRELIC_LOGWATCH:
- logwatch-503.j2
- logwatch-cms-errors.j2
- logwatch-lms-errors.j2
when: COMMON_ENABLE_NEWRELIC
- role: minos
when: COMMON_ENABLE_MINOS
- name: Deploy forum
hosts: all
sudo: True
gather_facts: True
vars:
serial_count: 1
serial: "{{ serial_count }}"
roles:
- docker
- role: nginx
nginx_sites:
- forum
- forum
../../playbooks/library/
\ No newline at end of file
- name: Deploy nginx
hosts: all
sudo: True
gather_facts: True
vars:
serial_count: 1
serial: "{{ serial_count }}"
roles:
- docker
- role: nginx
nginx_sites:
- lms
- cms
- xqueue
- certs
nginx_default_sites:
- lms
nginx_extra_sites: "{{ NGINX_EDXAPP_EXTRA_SITES }}"
nginx_extra_configs: "{{ NGINX_EDXAPP_EXTRA_CONFIGS }}"
nginx_redirects: "{{ NGINX_EDXAPP_CUSTOM_REDIRECTS }}"
../../playbooks/roles/
\ No newline at end of file
- name: Deploy xqueue
hosts: all
sudo: True
gather_facts: True
roles:
- docker
- role: xqueue
- role: nginx
nginx_sites:
- xqueue
- role: datadog
when: COMMON_ENABLE_DATADOG
- role: splunkforwarder
when: COMMON_ENABLE_SPLUNKFORWARDER
- role: newrelic
NEWRELIC_LOGWATCH:
- logwatch-xqueue-errors.j2
when: COMMON_ENABLE_NEWRELIC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment