Sign inSign up

lanterndata/lantern-self-hosted

By lanterndata

•Updated almost 2 years ago

Image
0

3.9K

lanterndata/lantern-self-hosted repository overview

⁠Self-Hosted Deployment

  1. Setup compose file

Fill in: <memory>, <shared_memory>, <superuser_password>, <user_username>, <user_password>, <backup_bucket>,<backup_location>

Set <memory> to 95% of total machine RAM. Set <shared_memory> to 50% of shared memory.

Parameters <backup_bucket>,<backup_location> are optional. If they are not set, backups will not be enabled.

services:
  postgresql:
    image: lanterndata/lantern-self-hosted:lantern-0.2.7-extras-0.1.5-minor-2
    ports:
    - 5432:5432
    - 6432:6432
    volumes:
    - "./lantern-data:/bitnami/postgresql"
    deploy:
      restart_policy:
        condition: always
      resources:
        limits:
          memory: <memory>MB
    shm_size: <shared_memory>MB
    environment:
    - "POSTGRESQL_DATABASE=postgres"
    - "POSTGRESQL_POSTGRES_PASSWORD=<superuser_password>"
    - "POSTGRESQL_USERNAME=<user_username>"
    - "POSTGRESQL_PASSWORD=<user_password>"
    - "WALG_S3_PREFIX=s3://<backup_bucket>/<backup_location>"
    - "POSTGRESQL_AUTO_BASE_BACKUP=yes"
    - "LANTERN_AUTO_INIT=yes"
    - "POSTGRESQL_LOG_DURATION=true"
    - "POSTGRESQL_LOG_MIN_DURATION_STATEMENT=250ms"

If server role does not have access to s3 bucket (read/write/delete/list) you need to pass AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables.

  1. Setup data folder and start the database
mkdir lantern-data && \
sudo chown 1001:1001 lantern-data && \
sudo docker compose up -d
  1. Recompile lantern with march=native [optional]
sudo docker compose exec -u root -T postgresql /opt/bitnami/scripts/lantern/install.sh v0.2.7

If you want to have native build, you also need to map extensions folder to host, so the native built lantern would persist after restart.

Run:

mkdir lantern-pg && \
sudo chown 1001:1001 lantern-pg

and add in volume mapping:

 - "./lantern-pg:/opt/bitnami/postgresql"

Tag summary

Content type

Image

Digest

sha256:432559332…

Size

1.4 GB

Last updated

almost 2 years ago

docker pull lanterndata/lantern-self-hosted