Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:14-slim

# @see Derived from https://github.com/GoogleChrome/rendertron/issues/775

# Update aptitude with new repo
RUN apt-get update

# Install software
RUN apt-get install -y git

# Install Chromium dependencies (https://github.com/puppeteer/puppeteer/issues/1598#issuecomment-473436669)
RUN apt-get install -y libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libnss3 libasound2

# Fetch repository
RUN git clone https://github.com/GoogleChrome/rendertron.git

# Get inside the cloned folder
WORKDIR ./rendertron

# Copy config.json from local filesystem to image working-dir
COPY config.json .

# Build application
RUN npm install
RUN npm run build

# Launch application
CMD [ "npm", "run", "start" ]

# Expose port
EXPOSE 3000/tcp
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm run build
## デプロイ

```bash
gcloud app deploy app.yaml --project tellerapi-dev --no-promote
./deploy.sh tellerapi-dev
```

---
Expand Down
14 changes: 0 additions & 14 deletions app.json

This file was deleted.

9 changes: 0 additions & 9 deletions app.yaml

This file was deleted.

9 changes: 1 addition & 8 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
{
"cache": "datastore",
"cacheConfig": {
"cacheDurationMinutes": 1440,
"cacheMaxEntries": -1
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

意図的に消してるとのことなんですけど、ここが SEO 的にわりと微妙なところなので、最初は以前の仕様の通りの方が良いかなと考えています。

というのも、Googlebot が1サイトに対してクロールできる時間が限られているという前提(SEOチームの見解ではそういう認識だった気がします)で考えると、キャッシュがない状態では古いページであっても1ページをクロールするのに毎回10秒ずつかけることになり、他の新しいページをクロールする時間がなくなって、結果的にクロール対象となるページが少なくなる、という懸念があります。

実際、そういった理由で後からキャッシュを入れて、その後クロール対象になるページが増えていたはずです(ログ確認しておきます)

{}
24 changes: 24 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# @see Derived from https://github.com/GoogleChrome/rendertron/issues/775

GOOGLE_CLOUD_PROJECT=$1
REGION="asia-northeast1"
IMAGE="gcr.io/${GOOGLE_CLOUD_PROJECT}/rendertron"


# Build container image
gcloud \
--project=${GOOGLE_CLOUD_PROJECT} \
builds submit \
--tag \
$IMAGE

# Deploy service on Cloud Run
gcloud \
--project=${GOOGLE_CLOUD_PROJECT} \
run deploy \
rendertron \
--region=${REGION} \
--allow-unauthenticated \
--image $IMAGE