Improved nginx configuration + new images

- correct URL for community proxy
- allow nginx to recheck if backend was done before
- new karrot beta images
This commit is contained in:
Nick Sellen 2024-01-18 00:45:29 +00:00
parent abe5537bb0
commit 2e1c0a9b50
Signed by: nicksellen
GPG Key ID: 7C3A275C0DC2EFA1
3 changed files with 17 additions and 11 deletions

View File

@ -1,3 +1,3 @@
export NGINX_CONFIG_VERSION=v3
export NGINX_CONFIG_VERSION=v23
export GEOIP_CONFIG_VERSION=v1
export ENTRYPOINT_VERSION=v2
export ENTRYPOINT_VERSION=v3

View File

@ -2,7 +2,7 @@ version: "3.8"
services:
web:
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.3-frontend"
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.4-frontend-beta"
configs:
- source: nginx_config
target: /etc/nginx/conf.d/default.conf
@ -10,12 +10,13 @@ services:
- app
environment:
- DOMAIN
- FILE_UPLOAD_MAX_SIZE
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/api/config/"]
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 15s
timeout: 3s
retries: 2
start_period: 45s
start_period: 15s
networks:
- internal
- proxy
@ -33,7 +34,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
app:
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.5-backend"
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.6-backend-beta"
networks:
- internal
depends_on:
@ -104,12 +105,12 @@ services:
start_period: 45s
deploy:
labels:
- "coop-cloud.${STACK_NAME}.version=0.1.6+0.1.5"
- "coop-cloud.${STACK_NAME}.version=0.1.7+0.1.6"
- "backupbot.backup=true"
- "backupbot.backup.path=/app/uploads"
worker:
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.5-backend"
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.6-backend-beta"
depends_on:
# shiv + geoip data gets loaded on the first run of the app
# so to ensure it's available in the worker too, we need to wait

View File

@ -41,9 +41,9 @@ server {
alias /app/uploads/;
expires max;
}
location /community_proxy/ {
proxy_pass https://community.foodsaving.world/;
proxy_pass https://community.karrot.world/;
}
location ~ ^\/(api(\-auth)?|docs|silk)\/ {
@ -52,7 +52,12 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
# this port is whatever port 80 is mapped to outside the container
proxy_set_header Host $host:80;
proxy_pass http://app:8000;
# resolver + backend as a variable means can run when backend is not up yet
resolver 127.0.0.11 valid=3s;
set $backend app:8000;
proxy_pass http://$backend$request_uri;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;