forked from fossology/fossology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.Dockerfile
88 lines (74 loc) · 2.88 KB
/
docker-compose.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
82
83
84
85
86
87
88
# FOSSology Dockerfile
# Copyright Siemens AG 2016, [email protected]
# Copyright TNG Technology Consulting GmbH 2016-2017, [email protected]
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
#
# Description: Docker container image recipe
FROM debian:8.8
MAINTAINER Fossology <[email protected]>
WORKDIR /fossology
ENV _update="apt-get update"
ENV _install="apt-get install -y --no-install-recommends"
ENV _cleanup="eval apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"
RUN set -x \
&& $_update && $_install \
lsb-release curl php5 libpq-dev libdbd-sqlite3-perl libspreadsheet-writeexcel-perl postgresql-client \
sudo \
# for standalone mode:
postgresql \
&& $_cleanup
ADD utils/fo-installdeps utils/fo-installdeps
ADD install/scripts/php-conf-fix.sh install/scripts/php-conf-fix.sh
ADD utils/install_composer.sh utils/install_composer.sh
RUN set -x \
&& $_update \
&& /fossology/utils/fo-installdeps -e -y \
&& $_cleanup \
&& /fossology/install/scripts/php-conf-fix.sh --overwrite \
&& /fossology/utils/install_composer.sh
ADD . .
RUN chmod +x /fossology/install/docker-compose.docker-entrypoint.sh
RUN set -x \
&& make install \
&& make clean
RUN set -x \
&& /usr/local/lib/fossology/fo-postinstall --common \
&& mkdir -p /srv/fossology/repository/
################################################################################
# scheduler related
RUN /usr/local/lib/fossology/fo-postinstall \
--agent \
--scheduler-only
RUN set -x \
&& mkdir -p /var/log/fossology \
&& chown -R fossy:fossy /var/log/fossology \
&& chgrp -R fossy /usr/local/etc/fossology/ \
&& chmod -R g+wr /usr/local/etc/fossology/ \
&& chown fossy:fossy /usr/local/etc/fossology/Db.conf
################################################################################
# web related
RUN /usr/local/lib/fossology/fo-postinstall \
--web-only \
&& systemctl disable apache2
RUN set -x \
&& cp /fossology/install/src-install-apache-example.conf \
/etc/apache2/conf-available/fossology.conf \
&& ln -s /etc/apache2/conf-available/fossology.conf \
/etc/apache2/conf-enabled/fossology.conf \
&& echo Listen 8081 >/etc/apache2/ports.conf
RUN set -x \
&& chmod -R o+r /etc/apache2 \
&& mkdir -p /var/log/apache2/ \
&& ln -sf /proc/self/fd/1 /var/log/apache2/access.log \
&& ln -sf /proc/self/fd/1 /var/log/apache2/error.log \
&& chown -R fossy:fossy /var/log/apache2/ \
&& chown -R fossy:fossy /var/run/apache2/ \
&& chown -R fossy:fossy /var/lock/apache2/
EXPOSE 8081
################################################################################
VOLUME /srv/fossology/repository/
ENTRYPOINT ["/fossology/install/docker-compose.docker-entrypoint.sh"]