-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
86 lines (66 loc) · 2.07 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
82
83
84
85
86
ARG UBUNTU_VERSION=18.04
####################################
# Temporary image for building Duc #
####################################
FROM ubuntu:${UBUNTU_VERSION} AS build
ARG DUC_VERSION=1.4.4
RUN apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
build-essential \
checkinstall \
libcairo2-dev \
libncursesw5-dev \
libpango1.0-dev \
libtokyocabinet-dev \
pkg-config \
wget \
&& rm -rf /var/lib/apt/lists/*
ADD https://github.com/zevv/duc/releases/download/${DUC_VERSION}/duc-${DUC_VERSION}.tar.gz .
RUN tar xzf duc-${DUC_VERSION}.tar.gz \
&& cd duc-${DUC_VERSION} \
&& ./configure \
&& make \
&& checkinstall --install=no --default \
&& cp duc_${DUC_VERSION}-*.deb /duc.deb
###############################
# Final image for running Duc #
###############################
FROM ubuntu:${UBUNTU_VERSION}
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="Maximilian Köstler <[email protected]>" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/MaximilianKoestler/duc-service.git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0-rc1"
COPY --from=build /duc.deb /
RUN dpkg -i /duc.deb \
&& rm /duc.deb
RUN apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
cron \
fcgiwrap \
libcairo2 \
libpango-1.0 \
libpangocairo-1.0-0 \
libtokyocabinet9 \
nginx \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/www/html/*
# storage locaction for the database
RUN mkdir -p /database
# mount point for directories to index
RUN mkdir -p /scan
COPY app/nginx.conf /etc/nginx/nginx.conf
COPY app/ducrc /etc/ducrc
COPY app/duc.cgi /var/www/html/duc.cgi
COPY app/manual_scan.cgi /var/www/html/manual_scan.cgi
COPY app/log.cgi /var/www/html/log.cgi
COPY app/startup.sh /startup.sh
COPY app/scan.sh /scan.sh
COPY app/manual_scan.sh /manual_scan.sh
# Default schedule: everyday at midnight
ENV SCHEDULE 0 0 * * *
EXPOSE 80
STOPSIGNAL SIGTERM
CMD /startup.sh