mirror of https://github.com/LemmyNet/lemmy.git
Allow image upload in docker/dev/ (replaces #1765)
parent
007a43c012
commit
2a6a50e89a
|
@ -1,6 +1,16 @@
|
|||
version: '3.3'
|
||||
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:1-alpine
|
||||
ports:
|
||||
- "1236:1236"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
restart: always
|
||||
depends_on:
|
||||
- pictrs
|
||||
- lemmy-ui
|
||||
|
||||
lemmy:
|
||||
image: lemmy-dev:latest
|
||||
|
@ -17,12 +27,10 @@ services:
|
|||
|
||||
lemmy-ui:
|
||||
image: dessalines/lemmy-ui:dev
|
||||
ports:
|
||||
- "1235:1234"
|
||||
restart: always
|
||||
environment:
|
||||
- LEMMY_INTERNAL_HOST=lemmy:8536
|
||||
- LEMMY_EXTERNAL_HOST=localhost:8536
|
||||
- LEMMY_EXTERNAL_HOST=localhost:1234
|
||||
- LEMMY_HTTPS=false
|
||||
depends_on:
|
||||
- lemmy
|
||||
|
@ -42,8 +50,6 @@ services:
|
|||
|
||||
pictrs:
|
||||
image: asonix/pictrs:v0.2.6-r2
|
||||
ports:
|
||||
- "8537:8080"
|
||||
user: 991:991
|
||||
volumes:
|
||||
- ./volumes/pictrs:/mnt
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
worker_processes 1;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
upstream lemmy {
|
||||
server "lemmy:8536";
|
||||
}
|
||||
upstream lemmy-ui {
|
||||
server "lemmy-ui:1234";
|
||||
}
|
||||
server {
|
||||
listen 1236;
|
||||
server_name localhost;
|
||||
|
||||
# frontend
|
||||
location / {
|
||||
set $proxpass "http://lemmy-ui";
|
||||
if ($http_accept = "application/activity+json") {
|
||||
set $proxpass "http://lemmy";
|
||||
}
|
||||
if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
|
||||
set $proxpass "http://lemmy";
|
||||
}
|
||||
if ($request_method = POST) {
|
||||
set $proxpass "http://lemmy";
|
||||
}
|
||||
proxy_pass $proxpass;
|
||||
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
|
||||
# Send actual client IP upstream
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
# backend
|
||||
location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
|
||||
proxy_pass "http://lemmy";
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# Add IP forwarding headers
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ services:
|
|||
- "8580:8580"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
restart: on-failure
|
||||
restart: always
|
||||
depends_on:
|
||||
- pictrs
|
||||
- lemmy-alpha-ui
|
||||
|
|
Loading…
Reference in New Issue