-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |