Skip to content

Commit

Permalink
Build a dev-quality Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Maxwell committed Mar 26, 2015
1 parent 6df70b7 commit e29becb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ target/
# virtualenv
/include
/bin
venv/

# vim swap files
*.swp
46 changes: 46 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Dockerfile for FIR development instance
# written by Kyle Maxwell
# build with the command:
#
# sudo docker build -t fir .
# sudo docker run -it -p 8000:8000 fir
#
# then access http://localhost:8000 in your browser

#MAINTAINER Kyle Maxwell, krmaxwell@gmail.com
FROM ubuntu:14.04
RUN apt-get update && \
apt-get dist-upgrade -y
RUN apt-get install -y --no-install-recommends \
python-pip \
python-dev \
python-lxml \
python-virtualenv \
libxml2-dev \
libxslt1-dev \
libz-dev \
build-essential \
git && \

groupadd -r fir && \
useradd -r -g fir -d /home/fir -s /sbin/nologin -c "FIR user" fir

WORKDIR /home
RUN git clone https://github.com/certsocietegenerale/FIR.git && \
mv /home/FIR /home/fir && \
chown -R fir:fir /home/fir && \
cd fir && \
pip install -r requirements.txt

USER fir
ENV HOME /home/fir
ENV USER fir
WORKDIR /home/fir
RUN ./manage.py syncdb --noinput && \
./manage.py migrate && \
./manage.py loaddata incidents/fixtures/seed_data.json && \
./manage.py loaddata incidents/fixtures/dev_users.json && \
cp fir/urls.py.sample fir/urls.py
EXPOSE 8000
ENTRYPOINT ["/home/fir/manage.py"]
CMD ["runserver", "0.0.0.0:8000"]

0 comments on commit e29becb

Please sign in to comment.