Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zkl94 committed Aug 12, 2015
1 parent fc47276 commit 3764e3c
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM fedora:latest
MAINTAINER Zhikun Lao <zlao@redhat.com>

LABEL Description = "product-definition-center"
LABEL Vendor = "Red Hat"
LABEL Version = "0.5"

RUN yum -y upgrade && yum install -y sudo tar git make gcc libuuid-devel python-devel swig krb5-devel koji python-mock python-ldap python-requests

# add runtime user (username and password are both `dev`) and add to sudoer
RUN useradd dev -p dev
RUN echo "dev ALL=(ALL) ALL" >> /etc/sudoers
ENV HOME /home/dev

USER dev
RUN git clone https://github.com/release-engineering/product-definition-center ${HOME}/product-definition-center

# solve dependencies and test
WORKDIR ${HOME}/product-definition-center
USER root
RUN make install
RUN make test

# firewall may have block the port?
# RUN iptables -I INPUT -p tcp --dport 8000 --syn -j ACCEPT

USER dev
RUN python manage.py migrate
WORKDIR ${HOME}/product-definition-center/pdc

# change setting
RUN cp settings_local.py.dist settings_local.py
RUN echo "DEBUG = True" >> settings_local.py

# hotfix
RUN echo "REST_FRAMEWORK = {'DEFAULT_METADATA_CLASS': 'contrib.bulk_operations.metadata.BulkMetadata'}" >> settings_local.py

# deploy
USER root
EXPOSE 8000
RUN pip install gunicorn greenlet eventlet gevent

# set up `virtualenv + virtualenvwrapper`
RUN curl -sL https://raw.githubusercontent.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | $SHELL

# container start as user `dev`
USER dev

# add volume
VOLUME ${HOME}

CMD ["/bin/bash"]

0 comments on commit 3764e3c

Please sign in to comment.