Adding nginx, fixing up docker-compose files, fixing docs.

This commit is contained in:
Dessalines 2020-09-12 10:18:56 -05:00
parent 3136df3334
commit 4023fe96fc
6 changed files with 51 additions and 22 deletions

View file

@ -51,8 +51,9 @@ server {
# Upload limit for pictrs
client_max_body_size 20M;
location / {
proxy_pass http://0.0.0.0:8536;
# lemmy api
location /api/v1 {
proxy_pass http://0.0.0.0:8536/api/v1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -69,6 +70,23 @@ server {
limit_req zone=lemmy_ratelimit burst=30 nodelay;
}
# Docs
location /docs {
proxy_pass http://0.0.0.0:8536/docs;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# lemmy-isomorphic-ui
location / {
proxy_pass http://0.0.0.0:1235;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Redirect pictshare images to pictrs
location ~ /pictshare/(.*)$ {
return 301 /pictrs/image/$1;

View file

@ -33,8 +33,6 @@
port: 8536
# json web token for authorization between server and client
jwt_secret: "changeme"
# The location of the frontend
front_end_dir: "../ui/dist"
# address where pictrs is available
pictrs_url: "http://pictrs:8080"
# rate limits for various user actions, by user ip

View file

@ -16,11 +16,14 @@ services:
- postgres
- iframely
lemmy-isomorphic-ui:
image: lemmy-isomorphic-ui:latest
image: dessalines/lemmy-isomorphic-ui:v0.0.5
# image: lemmy-isomorphic-ui:latest
ports:
- "1235:1234"
environment:
- LEMMY_HOST=lemmy
- LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_EXTERNAL_HOST=localhost:8536
- LEMMY_HTTPS=false
depends_on:
- lemmy

2
docker/lemmy.hjson vendored
View file

@ -30,8 +30,6 @@
# host where postgres is running
host: "postgres"
}
# The location of the frontend
front_end_dir: "/app/dist"
# # optional: email sending configuration
# email: {
# # hostname of the smtp server

View file

@ -25,6 +25,18 @@ services:
- pictrs
- iframely
lemmy-isomorphic-ui:
image: dessalines/lemmy-isomorphic-ui:v0.0.5
# image: lemmy-isomorphic-ui:latest
ports:
- "1235:1234"
environment:
- LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_EXTERNAL_HOST=localhost:8536
- LEMMY_HTTPS=false
depends_on:
- lemmy
pictrs:
image: asonix/pictrs:v0.1.13-r0
ports:

View file

@ -98,7 +98,7 @@ async fn main() -> Result<(), LemmyError> {
.configure(|cfg| images::config(cfg, &rate_limiter))
.configure(nodeinfo::config)
.configure(webfinger::config)
.service(actix_files::Files::new("/docs", "/documentation"))
.service(actix_files::Files::new("/docs", "/app/documentation"))
})
.bind((settings.bind, settings.port))?
.run()