Skip to content

Commit 8a866ff

Browse files
authored
Merge pull request #1 from justcoded/develop
Fixed make init/run, docker-compose
2 parents ebb5d62 + 5fd1c22 commit 8a866ff

6 files changed

Lines changed: 33 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
-------------------------------------------------------------------------

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
.PHONY: init build build-server build-storage up run start down stop
2+
13
init:
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...'; \

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
```
3234
http://localhost:3000/render?url=https://www.example.com/

docker-compose.example.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ RUN apk add chromium
44

55
WORKDIR /app
66

7-
COPY ../../src /app
7+
COPY ./src /app
88

99
RUN go build -o prerender ./cmd/server/main.go
1010

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM golang:1.16-alpine
22

33
WORKDIR /app
44

5-
COPY ../../src /app
5+
COPY ./src /app
66

77
RUN go build -o storage ./cmd/storage/main.go
88

0 commit comments

Comments
 (0)