File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Change Log
2+
3+ All notable changes to this project will be documented in this file.
4+
5+ The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
6+ and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7+
8+ -------------------------------------------------------------------------
9+
10+ ## [ 1.0.0] ( ) - _ 2021-10-05_
11+ ### Added
12+ * Taken https://github.com/goprerender/prerender as a base
13+ * Added support to pass ` STORAGE_URL ` environment variable
14+ * Dockerized goprerender server and storage
15+ * Added docker-compose example and Makefile commands for faster setup
16+
17+ -------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1+ .PHONY : init build build-server build-storage up run start down stop
2+
13init :
24 @if [ ! -f ' .env' ]; then \
35 echo ' Copying .env file...' ; \
46 cp .env.example .env; \
57 fi ;
68 @if [ ! -f ' src/.env' ]; then \
79 echo ' Copying src/.env file...' ; \
8- cp . src/env.example src/.env; \
10+ cp src/. env.example src/.env; \
911 fi ;
1012 @if [ ! -f ' docker-compose.yml' ]; then \
1113 echo ' Copying docker-compose.yml file...' ; \
Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ Run `make build` to build both Go applications server and storage.
2626
2727#### Usage
2828
29- The URL you want to load. Returns HTML by default.
29+ To run docker compose stack just run ` make up ` .
30+
31+ To prerender some URL you need to specify it as a query parameter, like this:
3032
3133```
3234http://localhost:3000/render?url=https://www.example.com/
Original file line number Diff line number Diff line change @@ -4,15 +4,18 @@ services:
44 server :
55 build :
66 context : ./
7- dockerfile : ./build/server/Dockerfile
7+ dockerfile : ./docker/server/Dockerfile
8+ environment :
9+ STORAGE_URL : ' storage:50051'
10+ PAGE_WAIT_TIME : 5
811 ports :
9- - ' ${STORAGE_PORT}:50051 '
10- depends_on :
12+ - ' ${SERVER_PORT}:3000 '
13+ links :
1114 - storage
1215
1316 storage :
1417 build :
1518 context : ./
16- dockerfile : ./build /storage/Dockerfile
19+ dockerfile : ./docker /storage/Dockerfile
1720 ports :
18- - ' ${SERVER_PORT}:3000 '
21+ - ' ${STORAGE_PORT}:50051 '
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ RUN apk add chromium
44
55WORKDIR /app
66
7- COPY ../.. /src /app
7+ COPY ./src /app
88
99RUN go build -o prerender ./cmd/server/main.go
1010
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ FROM golang:1.16-alpine
22
33WORKDIR /app
44
5- COPY ../.. /src /app
5+ COPY ./src /app
66
77RUN go build -o storage ./cmd/storage/main.go
88
You can’t perform that action at this time.
0 commit comments