Skip to content

Commit

Permalink
Build assets
Browse files Browse the repository at this point in the history
  • Loading branch information
yguedidi committed Sep 25, 2023
1 parent 36d4bf5 commit f2df344
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 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.4

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:18-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.4
ARG WALLABAG_VERSION

RUN set -ex \
&& apk add --no-cache \
Expand Down Expand Up @@ -78,6 +92,8 @@ RUN set -ex \
&& 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 f2df344

Please sign in to comment.