Skip to content

Commit

Permalink
add pass via nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghaoz committed Jun 3, 2019
1 parent b44ad80 commit 68a10d6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
29 changes: 26 additions & 3 deletions README.md
Expand Up @@ -2,12 +2,24 @@

# SteamLens

[![Website](https://img.shields.io/website-up-down-green-red/https/steamlens.gorse.io.svg)](http://steamlens.gorse.io)
[![Website](https://img.shields.io/website-up-down-green-red/https/steamlens.gorse.io.svg)](https://steamlens.gorse.io)

SteamLens is a tutorial steam video game recommender system based on Flask and gorse.

## Usage

### Download Source

First, clone the repo and enter the folder.

```bash
# Download source
git clone https://github.com/zhenghaoz/SteamLens.git

# Enter source folder
cd SteamLens
```

### Create database

It's a good idea to build recomender system based on existed dataset such as [Steam Dataset](https://steam.internet.byu.edu/).
Expand All @@ -34,14 +46,25 @@ SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

### Build & Run

Build the Docker image and run an instance. Remember to mount the data folder and expose the port of HTTP service.
Build the Docker image and run an instance. Remember to mount the data folder and expose the port of uWSGI.

```bash
# Build Docker image
docker build -t zhenghaoz/SteamLens .

# Run an instance
docker run -v data:/root/data \
docker run -d -v $(pwd)/data:/root/data \
-p 5000:5000 \
zhenghaoz/SteamLens
```

### Pass via Nginx

Set `uwsgi_pass` in Nginx.

```nginx
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:5000;
}
```
4 changes: 2 additions & 2 deletions config/gorse.toml
@@ -1,11 +1,11 @@
# This section declares settings for the server.
[server]
host = "0.0.0.0" # server host
host = "0.0.0.0" # server host
port = 8080 # server port

# This section declares setting for the database.
[database]
file = "data/gorse.db" # database file
file = "data/gorse.db" # database file

# This section declares settings for recommendation.
[recommend]
Expand Down
6 changes: 3 additions & 3 deletions config/steamlens.cfg
@@ -1,10 +1,10 @@
; Configuration for gorse
# Configuration for gorse
GORSE_API_URI = 'http://127.0.0.1:8080'
GORSE_NUM_ITEMS = 30

; Configuration for SQL
# Configuration for SQL
SQLALCHEMY_DATABASE_URI = 'sqlite:///../data/steamlens.db'

; Configuration for OpenID
# Configuration for OpenID
OPENID_STIRE = '../data/openid_store'
SECRET_KEY = 'STEAM_API_KEY'
4 changes: 2 additions & 2 deletions uwsgi.ini
@@ -1,6 +1,6 @@
[uwsgi]
# Http access port.
http=0.0.0.0:5000
# Socket pass port.
socket=0.0.0.0:5000

# Point to the main directory of the Web Site
chdir=/root/steamlens/
Expand Down

0 comments on commit 68a10d6

Please sign in to comment.