Skip to content

Instantly share code, notes, and snippets.

@yeukhon
Created October 3, 2014 05:19
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 yeukhon/379eee93b1c48c47ce31 to your computer and use it in GitHub Desktop.
Save yeukhon/379eee93b1c48c47ce31 to your computer and use it in GitHub Desktop.
FROM ubuntu:12.04.5
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y openssh-server git curl python-dev libpq-dev wget
RUN wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get install -y postgresql-9.3
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py
RUN git clone https://github.com/yeukhon/poll-app
RUN pip install -r poll-app/requirements.txt
#RUN python poll-app/setup.py develop
USER postgres
RUN /etc/init.d/postgresql start &&\
psql --command "ALTER USER Postgres WITH PASSWORD '12345678';" &&\
createdb -O postgres poll_app &&\
createdb -O postgres test_pollapp
USER root
ENTRYPOINT ["/usr/bin/python"]
RUN cp poll-app/configurations/production.ini.example poll-app/production.ini
RUN python -m SimpleHTTPServer
#CMD ["initialize_pollapp_db"]
#poll-app/production.ini"]
#CMD ["gunicorn --paste poll-app/production.ini -w 2 -t 3600 &"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment