1
0
mirror of https://github.com/immich-app/immich.git synced 2025-01-10 00:28:47 +02:00

breaking(setup): use non-root image for immich-proxy ()

* feat(nginx): use non-root container for immich-proxy

Signed-off-by: PixelJonas <5434875+PixelJonas@users.noreply.github.com>

* re-add test env

* feat(nginx): add correct port for staging

* add the new port to the default docker-compose.yml

Signed-off-by: PixelJonas <5434875+PixelJonas@users.noreply.github.com>
This commit is contained in:
Jonas Janz 2022-09-14 04:50:10 +02:00 committed by GitHub
parent ccf792f9d3
commit 1a6c16d8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 83 additions and 72 deletions

View File

@ -102,8 +102,7 @@ services:
context: ../nginx context: ../nginx
dockerfile: Dockerfile dockerfile: Dockerfile
ports: ports:
- 2283:80 - 2283:8080
- 2284:443
logging: logging:
driver: none driver: none
depends_on: depends_on:

View File

@ -72,8 +72,7 @@ services:
container_name: immich_proxy container_name: immich_proxy
image: altran1502/immich-proxy:staging image: altran1502/immich-proxy:staging
ports: ports:
- 2283:80 - 2283:8080
- 2284:443
logging: logging:
driver: none driver: none
depends_on: depends_on:

View File

@ -74,7 +74,7 @@ services:
container_name: immich_proxy container_name: immich_proxy
image: altran1502/immich-proxy:release image: altran1502/immich-proxy:release
ports: ports:
- 2283:80 - 2283:8080
logging: logging:
driver: none driver: none
depends_on: depends_on:

View File

@ -1,6 +1,5 @@
FROM nginx:latest FROM registry.access.redhat.com/ubi9/nginx-120:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf "${NGINX_CONF_PATH}"
EXPOSE 80 CMD nginx -g "daemon off;"
EXPOSE 443

View File

@ -1,73 +1,87 @@
map $http_upgrade $connection_upgrade {
default upgrade; worker_processes auto;
'' close; error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
} }
# events { http {
# worker_connections 1000; map $http_upgrade $connection_upgrade {
# } default upgrade;
'' close;
server {
gzip on;
gzip_min_length 1000;
gunzip on;
client_max_body_size 50000M;
listen 80;
access_log off;
location /api {
# Compression
gzip_static on;
gzip_min_length 1000;
gzip_comp_level 2;
proxy_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
rewrite /api/(.*) /$1 break;
proxy_pass http://immich-server:3001;
} }
location / { # events {
# worker_connections 1000;
# }
# Compression server {
gzip_static on;
gzip on;
gzip_min_length 1000; gzip_min_length 1000;
gzip_comp_level 2; gunzip on;
proxy_buffering off; client_max_body_size 50000M;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_http_version 1.1; listen 8080;
proxy_set_header Host $host; access_log off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_pass http://immich-web:3000; location /api {
# Compression
gzip_static on;
gzip_min_length 1000;
gzip_comp_level 2;
proxy_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
rewrite /api/(.*) /$1 break;
proxy_pass http://immich-server:3001;
}
location / {
# Compression
gzip_static on;
gzip_min_length 1000;
gzip_comp_level 2;
proxy_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_pass http://immich-web:3000;
}
} }
} }