Skip to content

Commit

Permalink
Build assets
Browse files Browse the repository at this point in the history
  • Loading branch information
yguedidi committed Aug 21, 2023
1 parent 4b4eb85 commit 5cce2fe
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG COMPOSER_VERSION=2.5.8
ARG WALLABAG_VERSION=2.6.2

FROM composer:$COMPOSER_VERSION as composer

Expand All @@ -9,11 +10,24 @@ FROM golang:alpine as builder
# flag -ldflags "-s -w" produces a smaller executable
RUN go install -ldflags "-s -w" -v github.com/a8m/envsubst/cmd/envsubst@v1.3.0

FROM node:16-alpine3.18 as assets

ARG WALLABAG_VERSION

RUN set -ex \
&& apk add --no-cache curl \
&& curl -L -o /tmp/wallabag.tar.gz https://github.com/wallabag/wallabag/archive/$WALLABAG_VERSION.tar.gz \
&& tar xvf /tmp/wallabag.tar.gz -C /tmp \
&& mv /tmp/wallabag-$WALLABAG_VERSION /tmp/wallabag \
&& cd /tmp/wallabag \
&& yarn install \
&& yarn build:prod

FROM alpine:3.18

COPY --from=builder /go/bin/envsubst /usr/bin/envsubst

ARG WALLABAG_VERSION=2.6.3
ARG WALLABAG_VERSION

RUN set -ex \
&& apk add --no-cache \
Expand Down Expand Up @@ -72,11 +86,14 @@ RUN set -ex \
&& rm -rf /tmp/wallabag* \
&& cd /var/www/wallabag \
&& mkdir data/assets \
&& rm -fr web/wallassets \
&& envsubst < /etc/wallabag/parameters.template.yml > app/config/parameters.yml \
&& SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist --no-progress \
&& rm -rf /root/.composer/* /var/www/wallabag/var/cache/* /var/www/wallabag/var/logs/* /var/www/wallabag/var/sessions/* \
&& chown -R nobody:nobody /var/www/wallabag

COPY --from=assets /tmp/wallabag/web/wallassets /var/www/wallabag/web/wallassets

ENV PATH="${PATH}:/var/www/wallabag/bin"

# Set console entry path
Expand Down

0 comments on commit 5cce2fe

Please sign in to comment.