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:
parent
abe5537bb0
commit
2e1c0a9b50
4
abra.sh
4
abra.sh
|
@ -1,3 +1,3 @@
|
||||||
export NGINX_CONFIG_VERSION=v3
|
export NGINX_CONFIG_VERSION=v23
|
||||||
export GEOIP_CONFIG_VERSION=v1
|
export GEOIP_CONFIG_VERSION=v1
|
||||||
export ENTRYPOINT_VERSION=v2
|
export ENTRYPOINT_VERSION=v3
|
||||||
|
|
13
compose.yml
13
compose.yml
|
@ -2,7 +2,7 @@ version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
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:
|
configs:
|
||||||
- source: nginx_config
|
- source: nginx_config
|
||||||
target: /etc/nginx/conf.d/default.conf
|
target: /etc/nginx/conf.d/default.conf
|
||||||
|
@ -10,12 +10,13 @@ services:
|
||||||
- app
|
- app
|
||||||
environment:
|
environment:
|
||||||
- DOMAIN
|
- DOMAIN
|
||||||
|
- FILE_UPLOAD_MAX_SIZE
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost/api/config/"]
|
test: ["CMD", "curl", "-f", "http://localhost/"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 2
|
retries: 2
|
||||||
start_period: 45s
|
start_period: 15s
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- proxy
|
- proxy
|
||||||
|
@ -33,7 +34,7 @@ services:
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
|
|
||||||
app:
|
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:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -104,12 +105,12 @@ services:
|
||||||
start_period: 45s
|
start_period: 45s
|
||||||
deploy:
|
deploy:
|
||||||
labels:
|
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=true"
|
||||||
- "backupbot.backup.path=/app/uploads"
|
- "backupbot.backup.path=/app/uploads"
|
||||||
|
|
||||||
worker:
|
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:
|
depends_on:
|
||||||
# shiv + geoip data gets loaded on the first run of the app
|
# 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
|
# so to ensure it's available in the worker too, we need to wait
|
||||||
|
|
|
@ -41,9 +41,9 @@ server {
|
||||||
alias /app/uploads/;
|
alias /app/uploads/;
|
||||||
expires max;
|
expires max;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /community_proxy/ {
|
location /community_proxy/ {
|
||||||
proxy_pass https://community.foodsaving.world/;
|
proxy_pass https://community.karrot.world/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^\/(api(\-auth)?|docs|silk)\/ {
|
location ~ ^\/(api(\-auth)?|docs|silk)\/ {
|
||||||
|
@ -52,7 +52,12 @@ server {
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
# this port is whatever port 80 is mapped to outside the container
|
# this port is whatever port 80 is mapped to outside the container
|
||||||
proxy_set_header Host $host:80;
|
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_redirect off;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
|
Loading…
Reference in New Issue