Commit 94c878c2 authored by xtof's avatar xtof

ok

parent 556cef0f
Pipeline #154896 passed with stage
in 2 seconds
...@@ -18,15 +18,15 @@ A common situation is the following, where we assume that you have: ...@@ -18,15 +18,15 @@ A common situation is the following, where we assume that you have:
Then the easiest way to install the platform is to use the latest docker image. Then the easiest way to install the platform is to use the latest docker image.
After cloning the OLKi repository and creating the .env file as explained [in the official documentation](https://framagit.org/synalp/olki/olki/-/wikis/Admin-documentation), you may still need to make the OLKi docker container connect smoothly to your apache web server. After cloning the OLKi repository, there are 3 configuration files that are important,
To do so, here is one solution that is working for me, you just need to configure 2 files: as explained [in the official documentation](https://framagit.org/synalp/olki/olki/-/wikis/Admin-documentation):
- The apache configuration file - The file "./.env" that contains the OLKi platform configuration
- The docker definition file - The file "./support/docker/.env" that contains the config to setup OLKi within docker
- The file "./support/docker/docker-compose.yml" that configure all docker containers together and with the host
### Apache configuration file You may still need to make the OLKi docker container connect smoothly to your apache web server !
To do so, just add these lines into your apache configuration file:
Just add these lines into your apache configuration file:
``` ```
<VirtualHost *:80> <VirtualHost *:80>
...@@ -48,120 +48,10 @@ Then reload this configuration file: ...@@ -48,120 +48,10 @@ Then reload this configuration file:
sudo systemctl reload apache2 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: 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 -d sudo docker-compose -f support/docker/docker-compose.yml up -d
``` ```
And you may now point any browser to http://olki.toto.fr ! And you may now point any browser to http://olki.toto.fr !
...@@ -170,14 +60,14 @@ And you may now point any browser to http://olki.toto.fr ! ...@@ -170,14 +60,14 @@ And you may now point any browser to http://olki.toto.fr !
You may launch the docker-compose command without the final "-d" to see in your terminal the logs. You may launch the docker-compose command without the final "-d" to see in your terminal the logs.
### "olki" cannot connect to "postgresql" #### "olki" cannot connect to "postgresql"
This is likely due to a configuration problem either in your .env, or in your docker-compose.yml . This is likely due to a configuration problem either in your .env, or in your docker-compose.yml .
Here are a few explanations about how everything should work, to help you identify the erroneous config: Here are a few explanations about how everything should work, to help you identify the erroneous config:
- docker-compose creates an internal network between your containers, and in particular the postgres and olki containers; each container in this network can be accessed by its name, e.g., "olki" and "postgres" (defined in docker-composer.yml) - docker-compose creates an internal network between your containers, and in particular the postgres and olki containers; each container in this network can be accessed by its name, e.g., "olki" and "postgres" (defined in docker-composer.yml)
- the postgres container exposes in this internal network the database on the standard 5432 port - the postgres container exposes in this internal network the database on the standard 5432 port
- so the olki container shall access the database at hostname "postgres" and port "5432": this should be defined in your .env, which should look like this: - so the olki container shall access the database at hostname "postgres" and port "5432": this should be defined in your support/docker/.env, which should look like this:
``` ```
DATABASE_URL=postgresql://olki:olki@postgres/olki DATABASE_URL=postgresql://olki:olki@postgres/olki
...@@ -200,10 +90,13 @@ OLKI_ADMIN_EMAIL=cerisara@loria.fr ...@@ -200,10 +90,13 @@ OLKI_ADMIN_EMAIL=cerisara@loria.fr
- In this .env, the first line defines the env variable that olki uses to access the db; the port is not given because it's the standard 5432 port; the "@postgres/" indicates the "hostname" of the container with the db; - In this .env, the first line defines the env variable that olki uses to access the db; the port is not given because it's the standard 5432 port; the "@postgres/" indicates the "hostname" of the container with the db;
- note that the internal network across containers has IP "172.18.0.X" - note that the internal network across containers has IP "172.18.0.X"
- I think the OLKI_WEBSERVER_* variables are not used any more, but it may be good to have them to avoid deprecated warnings (?)
- You may expose the platform on http, although for federation https is likely required; it may be possible to still not use https by setting the var EXTERNAL_REQUESTS_VERIFY_SSL to false, but this is not recommended.
- You don't really need SMTP, as you may always create users using the command-line
- if your .env looks correct, then double check that docker-compose is using **the correct .env file**: this is in the file docker-composer.yml, at the line: "source: ../../.env" - if your .env looks correct, then double check that docker-compose is using **the correct .env file**: this is in the file docker-composer.yml, at the line: "source: ../../.env"
### How to reset #### How to reset
``` ```
sudo su sudo su
......
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