diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -5,7 +5,7 @@ FROM python:3-alpine as docs | |||
5 | ADD . /usr/src/app/shaarli | 5 | ADD . /usr/src/app/shaarli |
6 | RUN cd /usr/src/app/shaarli \ | 6 | RUN cd /usr/src/app/shaarli \ |
7 | && pip install --no-cache-dir mkdocs \ | 7 | && pip install --no-cache-dir mkdocs \ |
8 | && mkdocs build | 8 | && mkdocs build --clean |
9 | 9 | ||
10 | # Stage 2: | 10 | # Stage 2: |
11 | # - Resolve PHP dependencies with Composer | 11 | # - Resolve PHP dependencies with Composer |
@@ -15,8 +15,17 @@ RUN cd shaarli \ | |||
15 | && composer --prefer-dist --no-dev install | 15 | && composer --prefer-dist --no-dev install |
16 | 16 | ||
17 | # Stage 3: | 17 | # Stage 3: |
18 | # - Frontend dependencies | ||
19 | FROM node:9.9-alpine as node | ||
20 | COPY --from=composer /app/shaarli shaarli | ||
21 | RUN cd shaarli \ | ||
22 | && yarn install \ | ||
23 | && yarn run build \ | ||
24 | && rm -rf node_modules | ||
25 | |||
26 | # Stage 4: | ||
18 | # - Shaarli image | 27 | # - Shaarli image |
19 | FROM alpine:3.6 | 28 | FROM alpine:3.8 |
20 | LABEL maintainer="Shaarli Community" | 29 | LABEL maintainer="Shaarli Community" |
21 | 30 | ||
22 | RUN apk --update --no-cache add \ | 31 | RUN apk --update --no-cache add \ |
@@ -47,12 +56,13 @@ RUN rm -rf /etc/php7/php-fpm.d/www.conf \ | |||
47 | 56 | ||
48 | 57 | ||
49 | WORKDIR /var/www | 58 | WORKDIR /var/www |
50 | COPY --from=composer /app/shaarli shaarli | 59 | COPY --from=node /shaarli shaarli |
51 | 60 | ||
52 | RUN chown -R nginx:nginx . \ | 61 | RUN chown -R nginx:nginx . \ |
53 | && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ | 62 | && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ |
54 | && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log | 63 | && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log |
55 | 64 | ||
65 | VOLUME /var/www/shaarli/cache | ||
56 | VOLUME /var/www/shaarli/data | 66 | VOLUME /var/www/shaarli/data |
57 | 67 | ||
58 | EXPOSE 80 | 68 | EXPOSE 80 |