- Open source, [AGPL License](/LICENSE).
- Self hostable, easy to deploy.
- - Comes with [Docker](#docker).
+ - Comes with [Docker](#docker), [Ansible](#ansible).
- Live-updating Comment threads.
- Full vote scores `(+/-)` like old reddit.
- Moderation abilities.
## Install
-### Ansible (recommended)
+### Docker
-First, you need to [install Ansible on your local computer](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html),
-eg using `sudo apt install ansible`, or the equivalent for you platform.
-
-Then run the following commands on your local computer:
-```bash
-git clone https://github.com/dessalines/lemmy.git
-cd lemmy/ansible/
-cp inventory.example inventory
-nano inventory # enter your server, domain, contact email
-ansible-playbook lemmy.yml
-```
-
-### Manual
-
-Make sure you have both docker and docker-compose installed.
+Make sure you have both docker and docker-compose(>=`1.24.0`) installed.
```
mkdir lemmy/
cd lemmy/
wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/env -O .env
-wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/nginx.conf
-# you need to edit .env and nginx.conf to replace the indicated {{ variables }}
-sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf
+# Edit the .env for custom passwords
docker-compose up -d
```
and goto http://localhost:8536
-### Nginx Config
+[A sample nginx config](/docker/prod/nginx.conf), could be setup with:
+
```
-location / {
- rewrite (\/(user|u|inbox|post|community|c|login|search|sponsors|communities|modlog|home)+) /static/index.html break;
- proxy_pass http://0.0.0.0:8536;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-
- # WebSocket support
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
-}
+wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/nginx.conf
+# Replace the {{ vars }}
+sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf
+```
+
+### Ansible
+
+First, you need to [install Ansible on your local computer](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html),
+eg using `sudo apt install ansible`, or the equivalent for you platform.
+
+Then run the following commands on your local computer:
+
+```bash
+git clone https://github.com/dessalines/lemmy.git
+cd lemmy/ansible/
+cp inventory.example inventory
+nano inventory # enter your server, domain, contact email
+ansible-playbook lemmy.yml
```
## Develop
image: postgres:12-alpine
restart: always
environment:
- POSTGRES_USER: rrr
- POSTGRES_PASSWORD: rrr
- POSTGRES_DB: rrr
+ - POSTGRES_USER=lemmy
+ - POSTGRES_PASSWORD=${DATABASE_PASSWORD}
+ - POSTGRES_DB=lemmy
volumes:
- lemmy_db:/var/lib/postgresql/data
healthcheck:
- test: ["CMD-SHELL", "pg_isready -U rrr"]
+ test: ["CMD-SHELL", "pg_isready -U lemmy"]
interval: 5s
timeout: 5s
retries: 20
ports:
- "8536:8536"
environment:
- LEMMY_FRONT_END_DIR: /app/dist
- DATABASE_URL: postgres://rrr:rrr@lemmy_db:5432/rrr
- JWT_SECRET: changeme
- HOSTNAME: rrr
+ - LEMMY_FRONT_END_DIR=/app/dist
+ - DATABASE_URL=${DATABASE_URL}
+ - JWT_SECRET=${JWT_SECRET}
+ - HOSTNAME=${DOMAIN}
restart: always
depends_on:
lemmy_db:
-version: "3.3"
+version: '2.4'
services:
-
- db:
+ lemmy_db:
image: postgres:12-alpine
restart: always
environment:
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=lemmy
volumes:
- - ./volumes/db:/var/lib/postgresql/data
+ - lemmy_db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lemmy"]
interval: 5s
timeout: 5s
retries: 20
-
lemmy:
- image: dessalines/lemmy:v0.0.7\r.3
+ image: dessalines/lemmy:v0.0.7.3
restart: always
ports:
- "8536:8536"
- DATABASE_URL=${DATABASE_URL}
- JWT_SECRET=${JWT_SECRET}
- HOSTNAME=${DOMAIN}
+ restart: always
depends_on:
- - db
+ lemmy_db:
+ condition: service_healthy
+volumes:
+ lemmy_db: