File tree Expand file tree Collapse file tree 5 files changed +219
-0
lines changed
Expand file tree Collapse file tree 5 files changed +219
-0
lines changed Original file line number Diff line number Diff line change 1+ name : build image
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ build :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : checkout
11+ uses : actions/checkout@v6.0.1
12+
13+ - name : docker setup qemy
14+ uses : docker/setup-qemu-action@v3.7.0
15+
16+ - name : setup docker buildx
17+ uses : docker/setup-buildx-action@v3
18+
19+ - name : load 1pass
20+ id : load-1pass
21+ uses : 1password/load-secrets-action@v3
22+ env :
23+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
24+ QUAY_USERNAME : " op://GitHub Actions/registry-creds/QUAY_USERNAME"
25+ QUAY_PASSWORD : " op://GitHub Actions/registry-creds/QUAY_PASSWORD"
26+
27+ - name : login to quay
28+ uses : docker/login-action@v3.4.0
29+ with :
30+ username : " ${{ steps.load-1pass.outputs.QUAY_USERNAME }}"
31+ password : " ${{ steps.load-1pass.outputs.QUAY_PASSWORD }}"
32+ registry : quay.io
33+
34+ - name : build and push
35+ uses : docker/build-push-action@v6.18.0
36+ with :
37+ platforms : linux/arm64,linux/amd64
38+ push : true
39+ tagas : quay.io/activeloop/prerender:latest,quay.io/activeloop/prerender:alpine
Original file line number Diff line number Diff line change 1+ FROM node:22-alpine
2+
3+ ENV CHROME_BIN=/usr/bin/chromium-browser
4+ ENV CHROME_PATH=/usr/lib/chromium/
5+ ENV MEMORY_CACHE=0
6+
7+ # install chromium, tini
8+ RUN apk add --no-cache chromium tini
9+
10+ USER node
11+ WORKDIR "/home/node"
12+
13+ COPY ./package.json .
14+ COPY ./server.js .
15+
16+ # install npm packages and clear cache
17+ RUN npm install --no-package-lock \
18+ && npm cache clean --force \
19+ && rm -rf /var/cache/apk/* /tmp/*
20+
21+ EXPOSE 3000
22+
23+ ENTRYPOINT ["tini" , "--" ]
24+ CMD ["node" , "server.js" ]
25+
Original file line number Diff line number Diff line change 1414 "compression" : " ^1.7.4" ,
1515 "express" : " ^4.17.1" ,
1616 "he" : " ^1.2.0" ,
17+ "prerender-aws-s3-cache" : " ^1.0.1" ,
1718 "uuid" : " ^8.3.2" ,
1819 "valid-url" : " ^1.0.9"
1920 },
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22var prerender = require ( './lib' ) ;
3+ var s3Cache = require ( 'prerender-aws-s3-cache' ) ;
34
45var server = prerender ( ) ;
56
@@ -9,5 +10,6 @@ server.use(prerender.browserForceRestart());
910server . use ( prerender . addMetaTags ( ) ) ;
1011server . use ( prerender . removeScriptTags ( ) ) ;
1112server . use ( prerender . httpHeaders ( ) ) ;
13+ server . use ( s3Cache ) ;
1214
1315server . start ( ) ;
You can’t perform that action at this time.
0 commit comments