Allow image upload in docker/dev/ (replaces #1765)

pictrs-no-gzip
Felix Ableitner 2021-09-17 10:54:43 +02:00
parent 007a43c012
commit 2a6a50e89a
3 changed files with 63 additions and 6 deletions

View File

@ -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

View File

@ -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;
}
}
}

View File

@ -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