forked from sebsauvage/Shaarli
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] docker: switch to Alpine Linux
Closes #843 Changed: - switch base image from Debian:Jessie to Alpine:3.5 - switch to PHP 7.1 - switch from supervisord to s6 to manage services WIP: - production/master image TODO: - thorough testing of Shaarli pages and features - production/stable image - development image FIXME: - theme selection (invalid paths detected) See: - https://alpinelinux.org/ - https://wiki.alpinelinux.org/wiki/Nginx_with_PHP - http://www.skarnet.org/software/s6/ - http://www.skarnet.org/software/s6/s6-svscan.html - http://www.skarnet.org/software/s6/s6-svc.html - http://www.skarnet.org/software/s6/s6-svstat.html Signed-off-by: VirtualTam <[email protected]>
- Loading branch information
1 parent
3a6f91a
commit 60fcfd9
Showing
8 changed files
with
59 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,47 @@ | ||
FROM debian:jessie | ||
FROM alpine:3.6 | ||
MAINTAINER Shaarli Community | ||
|
||
ENV TERM dumb | ||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends -y \ | ||
ca-certificates \ | ||
curl \ | ||
nginx-light \ | ||
php5-curl \ | ||
php5-fpm \ | ||
php5-gd \ | ||
php5-intl \ | ||
supervisor \ | ||
&& apt-get clean | ||
|
||
RUN sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php5/fpm/php.ini | ||
RUN sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php5/fpm/php.ini | ||
RUN apk --update --no-cache add \ | ||
ca-certificates \ | ||
curl \ | ||
nginx \ | ||
php7 \ | ||
php7-ctype \ | ||
php7-curl \ | ||
php7-fpm \ | ||
php7-gd \ | ||
php7-iconv \ | ||
php7-intl \ | ||
php7-json \ | ||
php7-mbstring \ | ||
php7-openssl \ | ||
php7-phar \ | ||
php7-session \ | ||
php7-xml \ | ||
php7-zlib \ | ||
s6 | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY supervised.conf /etc/supervisor/conf.d/supervised.conf | ||
COPY php-fpm.conf /etc/php7/php-fpm.conf | ||
COPY services.d /etc/services.d | ||
|
||
RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \ | ||
&& rm -rf /etc/php7/php-fpm.d/www.conf \ | ||
&& sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ | ||
&& sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini | ||
|
||
ADD https://getcomposer.org/composer.phar /usr/local/bin/composer | ||
RUN chmod 755 /usr/local/bin/composer | ||
|
||
WORKDIR /var/www | ||
RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ | ||
&& mv Shaarli-master shaarli \ | ||
&& cd shaarli \ | ||
&& composer --prefer-dist --no-dev install | ||
RUN rm -rf html \ | ||
&& chown -R www-data:www-data . | ||
&& composer --prefer-dist --no-dev install \ | ||
&& rm -rf ~/.composer \ | ||
&& chown -R nginx:nginx . | ||
|
||
VOLUME /var/www/shaarli/data | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] | ||
ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"] | ||
CMD [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[global] | ||
daemonize = no | ||
|
||
[www] | ||
user = nginx | ||
group = nginx | ||
listen.owner = nginx | ||
listen.group = nginx | ||
catch_workers_output = yes | ||
listen = /var/run/php-fpm.sock | ||
pm = dynamic | ||
pm.max_children = 20 | ||
pm.start_servers = 1 | ||
pm.min_spare_servers = 1 | ||
pm.max_spare_servers = 3 | ||
pm.max_requests = 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
/bin/true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/execlineb -P | ||
nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/execlineb -P | ||
php-fpm7 -F |
This file was deleted.
Oops, something went wrong.