-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (26 loc) · 1.73 KB
/
Dockerfile
File metadata and controls
45 lines (26 loc) · 1.73 KB
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
FROM ubuntu:bionic as source
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
git ca-certificates \
&& git clone https://github.com/SSilence/selfoss.git && cd selfoss \
&& git checkout 2.18
FROM composer:1.9 as composer
COPY --from=source /selfoss /selfoss
RUN cd /selfoss && composer install --ignore-platform-reqs --optimize-autoloader --no-dev
FROM node:12-stretch as npm
COPY --from=composer /selfoss /selfoss
RUN cd /selfoss && npm i && ./node_modules/.bin/grunt client:install
FROM php:7.3-apache-stretch
COPY --from=npm /selfoss /var/www/html/
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y libpng-dev \
&& docker-php-ext-install -j$(nproc) gd \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html/
RUN mkdir config && ln -s config/config.ini config.ini \
&& a2enmod rewrite \
&& /bin/echo -e "#!/bin/bash\nchown -R www-data:www-data /var/www/html/data/cache /var/www/html/data/favicons /var/www/html/data/logs /var/www/html/data/thumbnails /var/www/html/data/sqlite /var/www/html/public" > /entrypoint.sh \
&& /bin/echo -e "if [ ! -f config/config.ini ]; then cp defaults.ini config/config.ini && sed -i 's/logger_destination=.*$/logger_destination=file:php:\/\/stderr/' config/config.ini; fi" >> /entrypoint.sh \
&& /bin/echo -e "su www-data -s /bin/bash -c 'php /var/www/html/cliupdate.php' >/dev/null 2>&1" >> /entrypoint.sh \
&& /bin/echo -e "(while true; do su www-data -s /bin/bash -c 'php /var/www/html/cliupdate.php'; sleep 900; done;) &" >> /entrypoint.sh \
&& /bin/echo -e "apache2-foreground" >> /entrypoint.sh \
&& chmod a+x /entrypoint.sh
CMD [ "/entrypoint.sh" ]