Skip to content

Commit

Permalink
Merge pull request #10 from experius/develop
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
egordm authored Nov 29, 2020
2 parents ccf64ba + 784592b commit 01e8d09
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 92 deletions.
35 changes: 0 additions & 35 deletions .env

This file was deleted.

1 change: 1 addition & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# A hack. Since docker compose wont override this for some reason
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RENDERTRON_CACHE_RESOURCE_METHOD=GET
RENDERTRON_CACHE_HEADER_REQUEST_BLACKLIST=
RENDERTRON_CACHE_HEADER_RESPONSE_BLACKLIST=Set-Cookie,Content-Encoding,Transfer-Encoding

API_URL=http://dashboard:8080/docs/
API_URL=http://dashboard:80/docs/
API_VER=v1
API_NAME=snaptron
API_PASS=Sn@ptron1337
Expand All @@ -24,12 +24,12 @@ EXTERNAL_CACHE_SERVER_URL=
DB_ROOT_HOST=%
DB_HOST=db
DB_NAME=seosnap_dashboard
DB_USER=snaptron
DB_PASS=snaptron
DB_USER=snaptron_db
DB_PASS=snaptron_db

ADMIN_EMAIL=snaptron@snaptron.nl
ADMIN_NAME=snaptron
ADMIN_PASS=Sn@ptron1337
ADMIN_SECRET="https://miniwebtool.com/django-secret-key-generator/"
ADMIN_DEBUG=1
ADMIN_LOG_LEVEL=ERROR
ADMIN_LOG_LEVEL=ERROR
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
/.idea
/dev/instance
!/dev/instance/.gitkeep
!/.env
/.env
!/.env.example
/cache
!/cache/.gitkeep
/logs
!/logs/.gitkeep
.env

# Created by .ignore support plugin (hsz.mobi)
### Python template
Expand Down
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!make
DC_CONFIGS = -f docker-compose.yml -f seosnap-cacheserver/docker-compose.yml -f seosnap-cachewarmer/docker-compose.yml -f seosnap-dashboard/docker-compose.yml
DC_CONFIGS_DEV = -f docker-compose.yml -f seosnap-cacheserver/docker-compose.dev.yml -f seosnap-cachewarmer/docker-compose.dev.yml -f seosnap-dashboard/docker-compose.dev.yml


up:
docker-compose ${DC_CONFIGS} -f docker-compose.yml up

daemon:
docker-compose ${DC_CONFIGS} -f docker-compose.yml up -d

build:
docker-compose ${DC_CONFIGS} -f docker-compose.yml build

dc:
docker-compose ${DC_CONFIGS} -f docker-compose.yml ${A}

warm:
docker-compose ${DC_CONFIGS} -f docker-compose.yml run cachewarmer ${A}

install:
echo 'Running installation'
cp .env.example .env
sh seosnap-dashboard/dev/commands/install.sh

update:
git submodule update --init --recursive
git submodule foreach --recursive git fetch origin master
git submodule foreach --recursive git checkout master
echo "Everything is now up to date"

develop:
git submodule update --init --recursive
git submodule foreach --recursive git fetch origin develop
git submodule foreach --recursive git checkout develop
echo "Everything is now up to date"
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ Setup for the whole seosnap stack including dashboard, cache server and cache wa
page caching PWA's.

# Installation
* Pull the repo (*note: the pull is recursive*)
```
# Clone
git clone --recursive git@github.com:experius/SeoSnap.git
```
* **IMPORTANT** Update .env file admin username and password. (These have a value default value)
* Start, build and stop the container
```
docker-compose up --build -d && docker-compose down
# Configure
make install
# Start server
make up
```

# Usage
Expand All @@ -27,7 +26,8 @@ Cache directory ./cache
## Run cache warmer
Make sure you have created a website via dashboard http://127.0.0.1:8080/seosnap/website/add/
```
docker-compose run cachewarmer cache <website id>
make cachewarmer
make warm A="cache <website id>"
```

## Nginx
Expand Down Expand Up @@ -78,11 +78,11 @@ Options:
### Examples
```
# Cache the sitemap of website 1
docker-compose run cachewarmer cache 1
make warm A="cache 1"
# Cache requests in queue for websites 1 and 2
dc run cachewarmer cache 1,2 use_queue=true
make warm A="cache 1,2 use_queue=true"
# Clean the queue for websites 1 and 2
docker-compose run cachewarmer clean 1,2
make warm A="clean 1,2"
```
55 changes: 55 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: '3.7'
services:
dashboard:
build:
context: seosnap-dashboard
container_name: seosnap_stack_dashboard
env_file: .env
volumes:
- ./seosnap-dashboard:/code
- ./logs:/code/logs
networks:
- seosnap

cachewarmer:
build:
context: seosnap-cachewarmer
container_name: seosnap_stack_cachewarmer
env_file: .env
volumes:
- ./seosnap-cachewarmer:/code
- ./logs:/code/logs
depends_on:
- dashboard
- cacheserver
networks:
- seosnap

cacheserver:
build:
context: seosnap-cacheserver
container_name: seosnap_stack_cacheserver
env_file: .env
volumes:
- ./cache:/app/cache
- ./logs:/app/logs
depends_on:
- rendertron
networks:
- seosnap

rendertron:
container_name: snapstack_rendertron
networks:
- seosnap

db:
container_name: seosnap_stack_db
volumes:
- ./dev/instance/mariadb:/var/lib/mysql
networks:
- seosnap

networks:
seosnap:
driver: bridge
57 changes: 18 additions & 39 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,54 @@
version: '3.7'
services:
dashboard:
build: ./seosnap-dashboard
image: seosnap-dashboard
container_name: seosnap_dashboard
env_file: .env
environment:
DB_HOST_OVERRIDE: db
build:
context: seosnap-dashboard
container_name: seosnap_stack_dashboard
env_file: ./.env
volumes:
- ./seosnap-dashboard:/code
- ./logs:/code/logs
restart: "unless-stopped"
ports:
- 8080:8080
depends_on:
- db
networks:
- seosnap

cachewarmer:
build: ./seosnap-cachewarmer
image: seosnap-cachewarmer
container_name: seosnap_cachewarmer
env_file: .env
build:
context: seosnap-cachewarmer
container_name: seosnap_stack_cachewarmer
env_file: ./.env
volumes:
- ./seosnap-cachewarmer:/code
- ./logs:/code/logs
restart: "no"
depends_on:
- dashboard
- cacheserver
networks:
- seosnap

cacheserver:
build: ./seosnap-cacheserver
image: seosnap-cacheserver
container_name: seosnap_cacheserver
env_file: .env
build:
context: seosnap-cacheserver
container_name: seosnap_stack_cacheserver
env_file: ./.env
volumes:
- ./cache:/app/cache
- ./logs:/app/logs
restart: "unless-stopped"
ports:
- 5000:5000
depends_on:
- rendertron
networks:
- seosnap

rendertron:
image: ammobindotca/rendertron
container_name: rendertron
restart: "unless-stopped"
ports:
- 3000:3000
container_name: snapstack_rendertron
env_file: ./.env
volumes:
- ./seosnap-cacheserver/rendertron-config.json:/app/config.json
networks:
- seosnap

db:
image: mysql
entrypoint: ['/entrypoint.sh', '--default-authentication-plugin=mysql_native_password']
environment:
MYSQL_ROOT_HOST: ${DB_ROOT_HOST}
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
container_name: seosnap_stack_db
env_file: ./.env
volumes:
- ./dev/instance/mariadb:/var/lib/mysql
restart: "unless-stopped"
networks:
- seosnap

Expand Down
2 changes: 1 addition & 1 deletion seosnap-cacheserver
2 changes: 1 addition & 1 deletion seosnap-cachewarmer

0 comments on commit 01e8d09

Please sign in to comment.