-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile.aphlict
135 lines (115 loc) · 3.52 KB
/
Dockerfile.aphlict
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
##### Start Aphlict
FROM php:7.4-cli-buster
##### End Aphlict
LABEL org.opencontainers.image.source https://github.com/phabricator-docker/phabricator
# Required Components
# @see https://secure.phabricator.com/book/phabricator/article/installation_guide/#installing-required-comp
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
mercurial \
subversion \
ca-certificates \
# @see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944908
python3-pkg-resources \
python3-pygments \
imagemagick \
# @see https://secure.phabricator.com/w/guides/dependencies/
# provides ssh-keygen and ssh, these are needed to sync ssh repositories
openssh-client \
procps \
&& rm -rf /var/lib/apt/lists/*
# install the PHP extensions we need
RUN set -ex; \
\
if command -v a2enmod; then \
a2enmod rewrite; \
fi; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libonig-dev \
libcurl4-gnutls-dev \
libjpeg62-turbo-dev \
libpng-dev \
libfreetype6-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd \
--with-jpeg \
--with-freetype \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
mbstring \
iconv \
mysqli \
curl \
pcntl \
zip \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
RUN pecl channel-update pecl.php.net \
&& pecl install apcu \
&& docker-php-ext-enable apcu
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
# From Phabricator
echo 'opcache.validate_timestamps=0'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
# Set the default timezone.
RUN { \
echo 'date.timezone="UTC"'; \
} > /usr/local/etc/php/conf.d/timezone.ini
# File Uploads
RUN { \
echo 'post_max_size=32M'; \
echo 'upload_max_filesize=32M'; \
} > /usr/local/etc/php/conf.d/uploads.ini
# Repository Folder.
RUN mkdir /var/repo \
&& chown www-data:www-data /var/repo
##### Start Aphlict
RUN mkdir -p /var/log \
&& touch /var/log/aphlict.log \
&& chown www-data:www-data /var/log/aphlict.log
EXPOSE 22280
EXPOSE 22281
COPY --from=node:lts-buster /usr/local/bin/node /usr/local/bin/node
COPY --from=node:lts-buster /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm; \
ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx;
##### End Aphlict
COPY ./ /opt
WORKDIR /opt/phabricator
RUN git submodule update --init --recursive
ENV PATH "$PATH:/opt/phabricator/bin"
##### Start Aphlict
RUN npm install --prefix /opt/phabricator/support/aphlict/server ws
USER www-data
CMD aphlict debug
##### End Aphlict