Giter Site home page Giter Site logo

prerender-alpine's Introduction

Prerender Alpine

Lightweight Prerender container built on Alpine Linux with Node and Headless Chromium.

  • Prerender 5.20.4
  • Chromium 119.0.6045.159
  • Node 16.20.2

Requirements

  • Docker

Usage

Pull and run the image:

docker pull tvanro/prerender-alpine:6.6.1
docker run -p 3000:3000 tvanro/prerender-alpine:6.6.1

Prerender will now be running on http://localhost:3000. Try the container out with curl:

curl http://localhost:3000/render?url=https://www.example.com/

Prerender plugins

A few default plugins have been activated by default (see server.js):

This can be modified by creating your own server.js and mounting this file as a docker volume:

docker run -p 3000:3000 -v $(pwd)/server.js:/home/node/server.js tvanro/prerender-alpine:6.6.1 

Prerender memory cache

The prerender-memory-cache plugin is not activated by default. You can activate it with the environment variable MEMORY_CACHE=1.

You can customize cache behavior with environment variables :

  • CACHE_MAXSIZE=1000 : max number of objects in cache
  • CACHE_TTL=6000 : time to live in seconds
docker run -p 3000:3000 -e MEMORY_CACHE=1 -e CACHE_MAXSIZE=1000 -e CACHE_TTL=6000 tvanro/prerender-alpine:6.6.1 

Prerender documentation

Check out the official Prerender documentation: https://github.com/prerender/prerender

prerender-alpine's People

Contributors

cngarkar avatar mguyaux avatar palmik avatar tvanro avatar utkuozdemir avatar zicklag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

prerender-alpine's Issues

WAIT_TIME

Hello, sometimes needs to wait for the page to fully load (for example, long responses from the API server).
Could you add a "WAIT_TIME" env parameter (or something similar) to make the script wait a bit for the site to fully load?

New release date?

Hello, how often do you plan to update dependencies? I saw that prerender 5.20.0 was released already.

Stop responding after ~27 prerendered pages

Why prerender stopped working after 25-28 rendered pages?
When I restart container - it work again and again rendered only 27 pages and make some sleep function?
This behavior I saw last 2 years and i'm tired to fix this

Cannot start chrome with 6.6.0

We just recenlty upgraded to 6.6.0 and chrome won't start, going back to 6.5.0 everything works fine, even if we use the very basic call without any config:
docker run -p 3000:3000 tvanro/prerender-alpine:6.6.0

We believe this might be related to the latest version of Chrome not being able to start anymore.

Not working with Ubuntu 18.04

This does not seem to work with Ubuntu 18.04. Running the container always fails:

root@prerender-test:~# docker run --name server.prerender tvanro/prerender-alpine:5.5.1
2019-04-02T07:38:02.391Z Starting Prerender
2019-04-02T07:38:02.394Z Starting Chrome
2019-04-02T07:38:02.405Z Prerender server accepting requests on port 3000
2019-04-02T07:38:02.422Z Chrome connection closed... restarting Chrome
2019-04-02T07:38:02.423Z Chrome died immediately after restart... stopping Prerender

It works with Ubuntu 16.04 though.

It also seems to share the issue with other similar docker images using Headless Chrome

api?

Hey, this is awesome. Thanks for making this docker image, the others seem to be so out of date.

Is there some ability with your image to selectively clear items out of the cache?

I was considering that this would work quite good if i just set very long cache (months) and manually clear it via api call when updating a record

Nice work, and thank you

Basic Auth

Hello!
How to enable basic auth? I tried via helm file env

env:
  BASIC_AUTH_PASSWORD: test
  BASIC_AUTH_USERNAME: test
  CACHE_MAXSIZE: "1000"
  CACHE_TTL: "6000"
  MEMORY_CACHE: "1"
  NODE_ENV: staging

But I see that request work without BA

│ 2023-11-21T14:12:46.465Z Initial request to https://www.google.com/                                                                                                                                              │
│ 2023-11-21T14:12:46.658Z Initial response from https://www.google.com/ with status code 200                                                                                                                      │
│ 2023-11-21T14:12:46.733Z Initial request finished https://www.google.com/                                                                                                                                        │
│ 2023-11-21T14:12:47.695Z got 200 in 1312ms for https://www.google.com/

Thank you for great work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.