More FPM excitement

This commit is contained in:
3wc 2021-08-26 12:02:21 +02:00
parent 3b565b135c
commit f71e43949a
3 changed files with 183 additions and 170 deletions

View File

@ -1,4 +1,4 @@
export NGINX_CONF_VERSION="v3"
export NGINX_CONF_VERSION="v1"
NC_APP_DIR="app:/var/www/html"

View File

@ -1,13 +1,13 @@
version: "3.8"
services:
web:
image: nginx:latest
image: nginx:1.20.0
configs:
- source: nginx_conf
target: /etc/nginx/nginx.conf
environment:
- DOMAIN=${DOMAIN}
- STACK_NAME=${STACK_NAME}
- DOMAIN
- STACK_NAME
volumes:
- nextcloud:/var/www/html/
- nextapps:/var/www/html/custom_apps:cached
@ -39,8 +39,8 @@ services:
- db_password
- admin_password
environment:
- DOMAIN=${DOMAIN}
- STACK_NAME=${STACK_NAME}
- DOMAIN
- STACK_NAME
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
@ -62,14 +62,13 @@ services:
- nextconfig:/var/www/html/config:cached
- ${EXTRA_VOLUME}
networks:
- proxy
- internal
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
deploy:
update_config:
failure_action: rollback
@ -89,34 +88,34 @@ services:
- "mariadb:/var/lib/mysql"
networks:
- internal
healthcheck:
test: 'mysql -p"$$(tr -d "\n" < /run/secrets/db_root_password)"'
interval: 20s
timeout: 2s
retries: 3
start_period: 30s
# healthcheck:
# test: 'mysql -p"$$(tr -d "\n" < /run/secrets/db_root_password)"'
# interval: 20s
# timeout: 2s
# retries: 3
# start_period: 30s
deploy:
labels: ["coop-cloud.${STACK_NAME}.db.version=10.5-9c681cef"]
cron:
image: nextcloud:22.1.0
volumes:
- nextcloud:/var/www/html/
- nextapps:/var/www/html/custom_apps:cached
- nextdata:/var/www/html/data:cached
- nextconfig:/var/www/html/config:cached
- ${EXTRA_VOLUME}
networks:
- internal
entrypoint: /cron.sh
deploy:
labels: ['coop-cloud.${STACK_NAME}.cron.version=22.1.0-89d9ab98']
cache:
image: redis:6.2.5-alpine
networks:
- internal
deploy:
labels:
- coop-cloud.${STACK_NAME}.cache.version=6.2.5-alpine-b658aeb0
# cron:
# image: nextcloud:22.1.0
# volumes:
# - nextcloud:/var/www/html/
# - nextapps:/var/www/html/custom_apps:cached
# - nextdata:/var/www/html/data:cached
# - nextconfig:/var/www/html/config:cached
# - ${EXTRA_VOLUME}
# networks:
# - internal
# entrypoint: /cron.sh
# deploy:
# labels: ['coop-cloud.${STACK_NAME}.cron.version=22.1.0-89d9ab98']
# cache:
# image: redis:6.2.5-alpine
# networks:
# - internal
# deploy:
# labels:
# - coop-cloud.${STACK_NAME}.cache.version=6.2.5-alpine-b658aeb0
secrets:
db_root_password:

View File

@ -1,8 +1,21 @@
server {
events {
worker_connections 768;
}
error_log /var/log/nginx/error.log warn;
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
upstream backend {
server {{ env "STACK_NAME" }}_app:9000;
}
server {
listen 80 http2;
listen [::]:80 http2;
server_name {{ env "DOMAIN" }};
@ -130,3 +143,4 @@ server {
try_files $uri $uri/ /index.php$request_uri;
}
}
}