roadmap/Dockerfile

42 lines
977 B
Docker
Raw Permalink Normal View History

2015-03-12 02:22:38 +00:00
FROM ubuntu
RUN apt-get update
2015-03-12 02:42:19 +00:00
RUN apt-get upgrade -y
# Requirements
2015-03-12 02:22:38 +00:00
RUN apt-get install -y python-dev
RUN apt-get install -y build-essential g++ git cmake zlib1g-dev libbz2-dev
RUN apt-get install -y libmysqlclient-dev
2015-03-12 02:42:19 +00:00
# Install Python Setuptools
RUN apt-get install -y python-setuptools
2015-03-12 02:22:38 +00:00
# Install pip
RUN easy_install pip
2015-03-12 02:42:19 +00:00
RUN apt-get -y install mysql-server
2015-03-12 02:22:38 +00:00
# Add and install Python modules
ADD roadmap/requirements.txt /roadmap/requirements.txt
2015-03-12 02:22:38 +00:00
RUN cd /roadmap; pip install -r requirements.txt
# Bundle app source
ADD roadmap /roadmap
ADD startup.sh /opt/startup.sh
# Change Mysql BindAddress
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
RUN /bin/bash /opt/startup.sh
RUN cd /roadmap; python manage.py migrate
2015-03-12 02:22:38 +00:00
# Expose
EXPOSE 8000
2015-03-12 02:42:19 +00:00
EXPOSE 3306
2015-03-12 02:22:38 +00:00
2015-03-12 02:42:19 +00:00
# http://txt.fliglio.com/2013/11/creating-a-mysql-docker-container/
# http://blogs.aws.amazon.com/application-management/post/Tx1ZLAHMVBEDCOC/Dockerizing-a-Python-Web-App