Skip to content

Instantly share code, notes, and snippets.

@lcamacho
Created October 17, 2014 13:04
Show Gist options
  • Save lcamacho/0f8b3d751c19dfd16a5c to your computer and use it in GitHub Desktop.
Save lcamacho/0f8b3d751c19dfd16a5c to your computer and use it in GitHub Desktop.
Dockerfile
FROM ubuntu:14.04
MAINTAINER Leonard Camacho <leonard.camacho@gmail.com>
RUN apt-get update && apt-get install -y python python-dev python-pip postgresql libpq-dev memcached libxml2-dev libxslt1-dev
ADD . /airmozilla
WORKDIR /airmozilla
RUN pip install -r requirements/compiled.txt
# If you're going to run tests uncomment this
RUN pip install -r requirements/dev.txt
USER postgres
RUN /etc/init.d/postgresql start && psql -c "ALTER ROLE postgres WITH ENCRYPTED PASSWORD 'mozilla'" &&\
createdb -T template0 -E UTF8 airmozilla && ./manage.py syncdb --noinput && ./manage.py migrate
USER root
#RUN chmod +x ./entry_point.sh
ENTRYPOINT ["./entry_point.sh"]
EXPOSE 8000
#!/bin/bash
/etc/init.d/postgresql start
/etc/init.d/memcached start
./manage.py runserver 0.0.0.0:8000
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment