Fixing docker install. Fixes #163

This commit is contained in:
Dessalines 2023-04-13 15:12:17 -04:00
parent ddf8f191da
commit 440774f827

View file

@ -16,39 +16,31 @@ mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs sudo chown -R 991:991 volumes/pictrs
``` ```
Open up your `docker-compose.yml`, and make sure `LEMMY_EXTERNAL_HOST` for `lemmy-ui` is set to your correct host.
```
- LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_EXTERNAL_HOST=your-domain.com
- LEMMY_HTTPS=false
```
If you'd like a different database password, you should also change it in the `docker-compose.yml` **before** your first run. If you'd like a different database password, you should also change it in the `docker-compose.yml` **before** your first run.
After this, have a look at the [config file](configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname, and possibly the db password. Then run: After this, have a look at the [config file](configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname, and possibly the db password. Then run:
`docker-compose up -d` `docker-compose up -d`
You can access the lemmy-ui at `http://localhost:1235` You can access the lemmy-ui at `http://localhost:80`
To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/nginx.conf), could be setup with: To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. You can use the following simple proxy:
```bash ```
wget https://raw.githubusercontent.com/LemmyNet/lemmy-ansible/main/templates/nginx.conf server_name your_domain;
# Replace the {{ vars }} location / {
# The default lemmy_port is 8536 proxy_pass http://localhost:LEMMY_PORT;
# The default lemmy_ui_port is 1235 include proxy_params;
sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf }
``` ```
You will also need to setup TLS, for example with [Let's Encrypt](https://letsencrypt.org/). After this you need to restart Nginx to reload the config. You can also setup TLS, for example with [Let's Encrypt](https://letsencrypt.org/). After this you need to restart Nginx to reload the config.
## Updating ## Updating
To update to the newest version, you can manually change the version in `docker-compose.yml`. Alternatively, fetch the latest version from our git repo: To update to the newest version, you can manually change the version in `docker-compose.yml`. Alternatively, fetch the latest version from our git repo:
```bash ```bash
wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/docker-compose.yml
docker-compose up -d docker-compose up -d
``` ```