-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
135 lines (87 loc) · 2.84 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
FROM php:8.4-fpm-alpine AS base
ENV DIRBROWSER_VERSION=3.9.0
RUN apk update && apk upgrade
RUN docker-php-ext-install opcache
RUN apk add --no-cache libzip-dev \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip
RUN apk add --no-cache autoconf build-base \
&& pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis \
&& apk del autoconf build-base
RUN apk add --no-cache redis
RUN apk add --no-cache nginx
RUN apk add --no-cache bash
RUN apk add --no-cache curl \
&& curl -fSsL https://github.com/adrianschubek/utpp/releases/download/0.5.0/utpp-alpine -o /usr/local/bin/utpp && chmod +x /usr/local/bin/utpp\
&& apk del curl
RUN apk add --no-cache composer
WORKDIR /var/www/html
RUN composer require "league/commonmark:^2.5"
RUN mkdir -p /data/nginx/cache
# for batch downloads
RUN mkdir -p /var/www/html/tmp
COPY server/nginx/nginx.conf /etc/nginx/nginx.conf
COPY server/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY server/php/fpm-pool.conf /usr/local/etc/php-fpm.d/www.conf
COPY server/php/php.ini /usr/local/etc/php/conf.d/custom.ini
COPY src/index.php /var/www/html
COPY src/worker.php /var/www/html
COPY src/init.sh /init.sh
RUN chmod +x /init.sh
COPY src/fswatcher.sh /fswatcher.sh
RUN chmod +x /fswatcher.sh
ENV THEME=default
ENV DATE_FORMAT=relative
ENV HASH=true
ENV TRANSITION=false
ENV HASH_FOLDER=false
ENV HASH_REQUIRED=false
ENV HASH_ALGO=sha256
ENV API=true
# TODO: full = popup fullscreen
# basic,popup,full
ENV LAYOUT=basic
# TODO: show files in tree on hover
ENV PREVIEW=false
ENV README_NAME=readme.md;readme.txt;readme.html;readme;read.me;read\ me;liesmich.md;liesmich.txt;liesmich;lies\ mich;index.html;index.htm;index.txt;license
ENV README_FIRST=false
ENV README_META=true
ENV DOWNLOAD_COUNTER=true
ENV README_RENDER=true
ENV OPEN_NEW_TAB=false
ENV HIGHLIGHT_UPDATED=true
ENV METADATA=true
ENV SEARCH=true
# s=simple,g=glob,r=regex
ENV SEARCH_ENGINE=s,g
# regex only:
ENV SEARCH_MAX_DEPTH=25
ENV SEARCH_MAX_RESULTS=100
# multi select batch file download
ENV BATCH_DOWNLOAD=true
# TODO: add more: https://www.php.net/manual/en/book.zlib.php
ENV BATCH_TYPE=zip
# https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.cm-default
ENV BATCH_ZIP_COMPRESS_ALGO=DEFAULT
# MB
ENV BATCH_MAX_TOTAL_SIZE=500
# MB per file
ENV BATCH_MAX_FILE_SIZE=100
# MB, how much system disk space to keep free at all times
ENV BATCH_MIN_SYSTEM_FREE_DISK=500
# watch filesystem for changes (inotify)
ENV WORKER_WATCH=true
# seconds auto re-scan. -1 for never
ENV WORKER_SCAN_INTERVAL=300
# manual rescan
ENV WORKER_FORCE_RESCAN=true
# password for triggering manual rescan
ENV WORKER_FORCE_RESCAN_KEY=
# by default only hashes again if modtime or size changed
ENV WORKER_ALWAYS_HASH=false
ENV WORKER_TTL_OFFSET=180
ENV WORKER_WATCH_DEBOUNCE=5
EXPOSE 8080
ENTRYPOINT ["/init.sh"]