aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-06-17 01:02:50 +0200
committerVirtualTam <virtualtam@flibidi.net>2018-06-17 01:02:50 +0200
commit2a3fe990dd0730fce9465bbef6ad1a01054f775d (patch)
tree4abc8afd3bd63145e66f77f9279de7b246ceb7bd
parent7cf436cea4d05fe667c479be8b909c55c3f1da40 (diff)
downloadShaarli-2a3fe990dd0730fce9465bbef6ad1a01054f775d.tar.gz
Shaarli-2a3fe990dd0730fce9465bbef6ad1a01054f775d.tar.zst
Shaarli-2a3fe990dd0730fce9465bbef6ad1a01054f775d.zip
docker: build the images from the local sources
Relates to https://github.com/shaarli/Shaarli/issues/1153 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
-rw-r--r--.docker/.htaccess (renamed from docker/.htaccess)0
-rw-r--r--.docker/nginx.conf (renamed from docker/alpine/nginx.conf)0
-rw-r--r--.docker/php-fpm.conf (renamed from docker/alpine/php-fpm.conf)0
-rwxr-xr-x.docker/services.d/.s6-svscan/finish (renamed from docker/alpine/services.d/.s6-svscan/finish)0
-rwxr-xr-x.docker/services.d/nginx/run (renamed from docker/alpine/services.d/nginx/run)0
-rwxr-xr-x.docker/services.d/php-fpm/run (renamed from docker/alpine/services.d/php-fpm/run)0
-rw-r--r--.dockerignore51
-rw-r--r--.gitattributes4
-rw-r--r--Dockerfile (renamed from docker/alpine/Dockerfile.master)25
-rw-r--r--Dockerfile.armhf (renamed from docker/alpine/Dockerfile.armhf.master)8
-rw-r--r--docker/alpine/Dockerfile.armhf.latest49
-rw-r--r--docker/alpine/Dockerfile.latest54
-rw-r--r--docker/alpine/IMAGE.md10
13 files changed, 74 insertions, 127 deletions
diff --git a/docker/.htaccess b/.docker/.htaccess
index f601c1ee..f601c1ee 100644
--- a/docker/.htaccess
+++ b/.docker/.htaccess
diff --git a/docker/alpine/nginx.conf b/.docker/nginx.conf
index 07fba33f..07fba33f 100644
--- a/docker/alpine/nginx.conf
+++ b/.docker/nginx.conf
diff --git a/docker/alpine/php-fpm.conf b/.docker/php-fpm.conf
index 0843c164..0843c164 100644
--- a/docker/alpine/php-fpm.conf
+++ b/.docker/php-fpm.conf
diff --git a/docker/alpine/services.d/.s6-svscan/finish b/.docker/services.d/.s6-svscan/finish
index 1dadeeaf..1dadeeaf 100755
--- a/docker/alpine/services.d/.s6-svscan/finish
+++ b/.docker/services.d/.s6-svscan/finish
diff --git a/docker/alpine/services.d/nginx/run b/.docker/services.d/nginx/run
index 21e7b0d6..21e7b0d6 100755
--- a/docker/alpine/services.d/nginx/run
+++ b/.docker/services.d/nginx/run
diff --git a/docker/alpine/services.d/php-fpm/run b/.docker/services.d/php-fpm/run
index 21dd0107..21dd0107 100755
--- a/docker/alpine/services.d/php-fpm/run
+++ b/.docker/services.d/php-fpm/run
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..a0d28dc6
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,51 @@
1# Docker-ignore
2.dev
3.git
4.github
5tests
6
7# Shaarli runtime resources
8cache/*
9data/*
10pagecache/*
11tmp/*
12
13# Eclipse project files
14.settings
15.buildpath
16.project
17
18# Raintpl generated pages
19*.rtpl.php
20
21# 3rd-party dependencies
22vendor/
23
24# Release archives
25*.tar.gz
26*.zip
27inc/languages/*/LC_MESSAGES/shaarli.mo
28
29# Development and test resources
30coverage
31doxygen
32sandbox
33phpmd.html
34
35# User plugin configuration
36plugins/*/config.php
37
38# 3rd party themes
39tpl/*
40!tpl/default
41!tpl/vintage
42
43# Front end
44node_modules
45tpl/default/js
46tpl/default/css
47tpl/default/fonts
48tpl/default/img
49tpl/vintage/js
50tpl/vintage/css
51tpl/vintage/img
diff --git a/.gitattributes b/.gitattributes
index 6b6ffbd5..9d22f11b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -33,7 +33,9 @@ Dockerfile text
33.travis.yml export-ignore 33.travis.yml export-ignore
34doc/**/*.json export-ignore 34doc/**/*.json export-ignore
35doc/**/*.md export-ignore 35doc/**/*.md export-ignore
36docker/ export-ignore 36.docker/ export-ignore
37.dockerignore export-ignore
38Dockerfile* export-ignore
37Doxyfile export-ignore 39Doxyfile export-ignore
38Makefile export-ignore 40Makefile export-ignore
39node_modules/ export-ignore 41node_modules/ export-ignore
diff --git a/docker/alpine/Dockerfile.master b/Dockerfile
index 7bbe1fb7..4cda6f31 100644
--- a/docker/alpine/Dockerfile.master
+++ b/Dockerfile
@@ -1,13 +1,20 @@
1# Stage 1: 1# Stage 1:
2# - Get Shaarli sources 2# - Copy Shaarli sources
3# - Build documentation
4FROM python:3-alpine as docs
5ADD . /usr/src/app/shaarli
6RUN cd /usr/src/app/shaarli \
7 && pip install --no-cache-dir mkdocs \
8 && mkdocs build
9
10# Stage 2:
3# - Resolve PHP dependencies with Composer 11# - Resolve PHP dependencies with Composer
4FROM composer:latest as composer 12FROM composer:latest as composer
5RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ 13COPY --from=docs /usr/src/app/shaarli /app/shaarli
6 && mv Shaarli-master shaarli \ 14RUN cd shaarli \
7 && cd shaarli \
8 && composer --prefer-dist --no-dev install 15 && composer --prefer-dist --no-dev install
9 16
10# Stage 2: 17# Stage 3:
11# - Frontend dependencies 18# - Frontend dependencies
12FROM node:9.9-alpine as node 19FROM node:9.9-alpine as node
13COPY --from=composer /app/shaarli shaarli 20COPY --from=composer /app/shaarli shaarli
@@ -16,7 +23,7 @@ RUN cd shaarli \
16 && yarn run build \ 23 && yarn run build \
17 && rm -rf node_modules 24 && rm -rf node_modules
18 25
19# Stage 3: 26# Stage 4:
20# - Shaarli image 27# - Shaarli image
21FROM alpine:3.6 28FROM alpine:3.6
22LABEL maintainer="Shaarli Community" 29LABEL maintainer="Shaarli Community"
@@ -39,9 +46,9 @@ RUN apk --update --no-cache add \
39 php7-zlib \ 46 php7-zlib \
40 s6 47 s6
41 48
42COPY nginx.conf /etc/nginx/nginx.conf 49COPY .docker/nginx.conf /etc/nginx/nginx.conf
43COPY php-fpm.conf /etc/php7/php-fpm.conf 50COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
44COPY services.d /etc/services.d 51COPY .docker/services.d /etc/services.d
45 52
46RUN rm -rf /etc/php7/php-fpm.d/www.conf \ 53RUN rm -rf /etc/php7/php-fpm.d/www.conf \
47 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ 54 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
diff --git a/docker/alpine/Dockerfile.armhf.master b/Dockerfile.armhf
index 6c89adc3..5dcc34aa 100644
--- a/docker/alpine/Dockerfile.armhf.master
+++ b/Dockerfile.armhf
@@ -1,5 +1,5 @@
1FROM lsiobase/alpine.armhf:3.6 1FROM lsiobase/alpine.armhf:3.6
2MAINTAINER Shaarli Community 2LABEL maintainer="Shaarli Community"
3 3
4RUN apk --update --no-cache add \ 4RUN apk --update --no-cache add \
5 ca-certificates \ 5 ca-certificates \
@@ -21,9 +21,9 @@ RUN apk --update --no-cache add \
21 php7-zlib \ 21 php7-zlib \
22 s6 22 s6
23 23
24COPY nginx.conf /etc/nginx/nginx.conf 24COPY .docker/nginx.conf /etc/nginx/nginx.conf
25COPY php-fpm.conf /etc/php7/php-fpm.conf 25COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
26COPY services.d /etc/services.d 26COPY .docker/services.d /etc/services.d
27 27
28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \ 28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
29 && rm -rf /etc/php7/php-fpm.d/www.conf \ 29 && rm -rf /etc/php7/php-fpm.d/www.conf \
diff --git a/docker/alpine/Dockerfile.armhf.latest b/docker/alpine/Dockerfile.armhf.latest
deleted file mode 100644
index 824a1926..00000000
--- a/docker/alpine/Dockerfile.armhf.latest
+++ /dev/null
@@ -1,49 +0,0 @@
1FROM lsiobase/alpine.armhf:3.6
2MAINTAINER Shaarli Community
3
4RUN apk --update --no-cache add \
5 ca-certificates \
6 curl \
7 nginx \
8 php7 \
9 php7-ctype \
10 php7-curl \
11 php7-fpm \
12 php7-gd \
13 php7-iconv \
14 php7-intl \
15 php7-json \
16 php7-mbstring \
17 php7-openssl \
18 php7-phar \
19 php7-session \
20 php7-xml \
21 php7-zlib \
22 s6
23
24COPY nginx.conf /etc/nginx/nginx.conf
25COPY php-fpm.conf /etc/php7/php-fpm.conf
26COPY services.d /etc/services.d
27
28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
29 && rm -rf /etc/php7/php-fpm.d/www.conf \
30 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
31 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
32
33
34WORKDIR /var/www
35RUN curl -L https://github.com/shaarli/Shaarli/archive/latest.tar.gz | tar xzf - \
36 && mv Shaarli-latest shaarli \
37 && cd shaarli \
38 && composer --prefer-dist --no-dev install \
39 && rm -rf ~/.composer \
40 && chown -R nginx:nginx . \
41 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
42 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
43
44VOLUME /var/www/shaarli/data
45
46EXPOSE 80
47
48ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
49CMD []
diff --git a/docker/alpine/Dockerfile.latest b/docker/alpine/Dockerfile.latest
deleted file mode 100644
index 755d8751..00000000
--- a/docker/alpine/Dockerfile.latest
+++ /dev/null
@@ -1,54 +0,0 @@
1# Stage 1:
2# - Get Shaarli sources
3# - Resolve PHP dependencies with Composer
4FROM composer:latest as composer
5RUN curl -L https://github.com/shaarli/Shaarli/archive/latest.tar.gz | tar xzf - \
6 && mv Shaarli-latest shaarli \
7 && cd shaarli \
8 && composer --prefer-dist --no-dev install
9
10# Stage 2:
11# - Shaarli image
12FROM alpine:3.6
13LABEL maintainer="Shaarli Community"
14
15RUN apk --update --no-cache add \
16 ca-certificates \
17 nginx \
18 php7 \
19 php7-ctype \
20 php7-curl \
21 php7-fpm \
22 php7-gd \
23 php7-iconv \
24 php7-intl \
25 php7-json \
26 php7-mbstring \
27 php7-openssl \
28 php7-session \
29 php7-xml \
30 php7-zlib \
31 s6
32
33COPY nginx.conf /etc/nginx/nginx.conf
34COPY php-fpm.conf /etc/php7/php-fpm.conf
35COPY services.d /etc/services.d
36
37RUN rm -rf /etc/php7/php-fpm.d/www.conf \
38 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
39 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
40
41
42WORKDIR /var/www
43COPY --from=composer /app/shaarli shaarli
44
45RUN chown -R nginx:nginx . \
46 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
47 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
48
49VOLUME /var/www/shaarli/data
50
51EXPOSE 80
52
53ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
54CMD []
diff --git a/docker/alpine/IMAGE.md b/docker/alpine/IMAGE.md
deleted file mode 100644
index a8952257..00000000
--- a/docker/alpine/IMAGE.md
+++ /dev/null
@@ -1,10 +0,0 @@
1## Alpine images
2- [Alpine Linux](https://www.alpinelinux.org/)
3- [PHP-FPM](http://php-fpm.org/)
4- [Nginx](http://nginx.org/)
5
6### `shaarli/shaarli:latest`
7- [Shaarli](https://github.com/shaarli/Shaarli), `latest` branch
8
9### `shaarli/shaarli:master`
10- [Shaarli](https://github.com/shaarli/Shaarli), `master` branch