-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proposed update for the Dockerfile to use the more lightweight alpine linux. This decreases the overall image size compared to ubuntu.
- Loading branch information
Robert Haist
authored and
Robert Haist
committed
Feb 29, 2016
1 parent
76d2fb6
commit c4e9f30
Showing
1 changed file
with
36 additions
and
27 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 |
---|---|---|
@@ -1,44 +1,53 @@ | ||
# Dockerfile for FIR development instance | ||
# written by Kyle Maxwell | ||
# written by Robert Haist | ||
# | ||
# Mostly based on the ubuntu image 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 | ||
#MAINTAINER Robert Haist, SleuthKid@mailbox.org | ||
FROM alpine:latest | ||
|
||
RUN apk add --update \ | ||
python \ | ||
python-dev \ | ||
py-pip \ | ||
build-base \ | ||
git \ | ||
libxml2 \ | ||
libxml2-dev \ | ||
libxslt \ | ||
libxslt-dev \ | ||
libzip \ | ||
libzip-dev \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
RUN addgroup fir && \ | ||
adduser -D -G fir -s /sbin/nologin fir | ||
|
||
WORKDIR /app | ||
|
||
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 | ||
chown -R fir:fir /app/FIR && \ | ||
cd FIR && \ | ||
pip install -r requirements.txt && \ | ||
cp fir/config/installed_apps.txt.sample fir/config/installed_apps.txt | ||
|
||
USER fir | ||
ENV HOME /home/fir | ||
ENV HOME /app/FIR | ||
ENV USER fir | ||
WORKDIR /home/fir | ||
|
||
WORKDIR /app/FIR | ||
|
||
RUN ./manage.py migrate && \ | ||
./manage.py loaddata incidents/fixtures/seed_data.json && \ | ||
./manage.py loaddata incidents/fixtures/dev_users.json | ||
|
||
EXPOSE 8000 | ||
ENTRYPOINT ["/home/fir/manage.py"] | ||
ENTRYPOINT ["/app/FIR/manage.py"] | ||
CMD ["runserver", "0.0.0.0:8000"] |