forked from Ghirensics/ghiro-docker
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
81 lines (63 loc) · 2.54 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
############################################################
# Ghiro Dockerfile
# https://getghiro.org
############################################################
#
# Copyright (C) 2016 Alessandro Tanasi
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
FROM ubuntu:16.04
MAINTAINER Alessandro Tanasi <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
ENV TIMEZONE Europe/Rome
ENV GHIRO_PASSWORD ghiromanager
ENV GHIRO_USER ghiro
# Copy requirements files.
COPY files/*.txt /tmp/
# Update repositories.
RUN apt-get update
# Setup basic deps.
RUN apt-get update
RUN xargs apt-get install -y < /tmp/deb-packages.txt
RUN rm /tmp/deb-packages.txt
RUN pip install --upgrade -r /tmp/pypi-packages.txt
RUN rm /tmp/pypi-packages.txt
# Configure timezone and locale
RUN echo "$TIMEZONE" > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata
RUN export LANGUAGE=en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
locale-gen en_US.UTF-8 && \
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
# Configure wkhtmltopdf
RUN printf '#!/bin/bash\nxvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
RUN chmod a+x /usr/bin/wkhtmltopdf.sh
RUN ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
# Checkout ghiro from git.
RUN git clone https://github.com/Ghirensics/ghiro.git /var/www/ghiro
# Setup python requirements using pypi.
RUN pip install -r /var/www/ghiro/requirements.txt
# Configure ghiro.
ADD local_settings.py /var/www/ghiro/ghiro/local_settings.py
# Ghiro setup.
RUN cd /var/www/ghiro && python manage.py syncdb --noinput
# Create super user.
RUN cd /var/www/ghiro && echo "from users.models import Profile; Profile.objects.create_superuser('$GHIRO_USER', '[email protected]', '$GHIRO_PASSWORD')" | python manage.py shell
# Add virtualhost
ADD ./ghiro.conf /etc/apache2/sites-available/
# Remove default virtualhost.
RUN a2dissite 000-default
# Enable ghiro virtualhost.
RUN a2ensite ghiro
# Clean-up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 80
ADD start.sh /start.sh
RUN chmod 0755 /start.sh
CMD ["bash", "start.sh"]