Skip to content

Instantly share code, notes, and snippets.

@heiths
Last active March 7, 2018 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heiths/2b4aadf8108cb20efea511faa1f9f271 to your computer and use it in GitHub Desktop.
Save heiths/2b4aadf8108cb20efea511faa1f9f271 to your computer and use it in GitHub Desktop.
run with: docker-compose -f poppy-compose.yaml up
zookeeper:
extends:
file: docker/compose/dependencies.yml
service: zookeeper
cassandra:
extends:
file: docker/compose/dependencies.yml
service: cassandra
poppy:
build: .
ports:
- "80:8080"
volumes:
- ".:/home/poppy/"
links:
- cassandra
- zookeeper
##
## Poppy
##
##
FROM ubuntu:14.04
MAINTAINER Amit Gandhi <amit.gandhi@rackspace.com>
RUN apt-get -qq update
RUN apt-get -qq upgrade
ADD . /home/poppy
WORKDIR /home/poppy
# Install Pip, Python, etc
RUN apt-get -qqy install git-core wget curl libpython-dev libev4 libev-dev libffi6 libffi-dev libssl-dev python-dev
# setuptools
RUN wget https://bootstrap.pypa.io/ez_setup.py
RUN python ez_setup.py
# pip
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py
# uwsgi
RUN pip install uwsgi
# Install Requirements
RUN sudo pip install -r /home/poppy/requirements/requirements.txt
# Install testrepository
RUN sudo pip install testrepository
RUN sudo pip install -e /home/poppy/.
# Set up the configuration files
ADD docker/api/poppy.conf /etc/poppy.conf
ADD docker/api/logging.conf /etc/logging.conf
ADD docker/api/uwsgi.ini /root/uwsgi.ini
# Deploy the startup script
ADD docker/api/startup.sh /usr/local/bin/poppy_startup
RUN chmod 755 /usr/local/bin/poppy_startup
# create uwsgi log directory
RUN mkdir -p /var/log/poppy
RUN chmod -R +w /var/log/poppy
# create uwsgi pid directory
RUN mkdir -p /var/run/poppy
RUN chmod -R +w /var/run/poppy
# Run the startup script
RUN chmod 755 /usr/local/bin/poppy_startup
EXPOSE 8080
ENV PYTHONUNBUFFERED 1
# wait for the cassandra container to initialize before starting up
CMD poppy_startup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment