Commit 591bbc21 authored by xtof's avatar xtof

ok

parent 154a0aaa
Pipeline #154115 passed with stage
in 4 seconds
---
title: "OLKi platform: quick install guide"
date: 2020-06-25T12:02:00+06:00
description : "OLKi platform: quick install guide"
type: post
image:
author: Christophe Cerisara
tags: ["AI"]
---
## Install the OLKi platform
A common situation is the following, where we assume that you have:
- An ubuntu computer with apache + docker
- A personal domain name, say "olki.toto.fr", which will be your entry point to your instance
Then the easiest way to install the platform is to use the latest docker image.
You do not need to download anything (docker will do it), but you just need to configure 2 files:
- The docker definition file
- The apache configuration file
### Apache configuration file
Just add these lines into your apache configuration file:
```
<VirtualHost *:80>
ServerName olki.toto.fr
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:5000/$1 [P,L]
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
```
Then reload this configuration file:
```
sudo systemctl reload apache2
```
### Docker-compose file
Copy-paste the following lines into a file "olkitoto.yml":
```
version: "3.3"
services:
reverse-proxy:
image: abiosoft/caddy
ports:
# - "80:80" # The HTTP port
# - "443:443" # The HTTPS port
- "127.0.0.1:5000:5000"
volumes:
- type: bind
source: ./Caddyfile
target: /etc/Caddyfile
- certificate:/root/.caddy
- media:/media
restart: ${RESTART_POLICY-unless-stopped}
environment:
- OLKI_WEBSERVER_HOST
depends_on:
- olki
olki:
image: ${OLKI_IMAGE-rigelk/olki}
env_file:
- .env
# For local access without passing through the reverse proxy (unsecure access)
# Do not enable when using stack
#ports:
# - "${OLKI_EXTERNAL_PORT-127.0.0.1:5000}:5000"
volumes:
- media:/app/olki_back/olki/media
- type: bind
source: ../../.env
target: /app/.env
depends_on:
- postgres
- redis
- postfix
restart: ${RESTART_POLICY-unless-stopped}
deploy:
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
networks:
- default
- inner
postgres:
image: sameersbn/postgresql:10-2
environment:
DB_USER: olki
DB_PASS: olki
DB_NAME: olki
DB_EXTENSION: 'unaccent,pg_trgm'
volumes:
- ./docker-volume/db:/var/lib/postgresql/data
restart: ${RESTART_POLICY-unless-stopped}
labels:
traefik.enable: "false"
deploy:
placement:
constraints: [node.role == manager]
networks:
- inner
redis:
image: redis:5-alpine
volumes:
- ./docker-volume/redis:/data
restart: ${RESTART_POLICY-unless-stopped}
labels:
traefik.enable: "false"
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
networks:
- inner
postfix:
image: mwader/postfix-relay
environment:
- POSTFIX_myhostname=${OLKI_WEBSERVER_HOST}
labels:
traefik.enable: "false"
restart: ${RESTART_POLICY-unless-stopped}
networks:
- inner
networks:
default:
inner:
volumes:
media:
certificate:
```
Then, you just have to launch the OLKi platform:
```
OLKI_WEBSERVER_HOST="http://127.0.0.1:5000" sudo -E docker-compose -f olkitoto.yml up
```
And you may now point any browser to http://olki.toto.fr !
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment