我在自托管的 IN4 安装上遇到了一个非常慢的 Web 界面问题。
它在 Ubuntu 20.04 LTS 上运行,通过 LAN IP,应用程序快速且响应迅速。但是,在反向代理后面并通过 Cloudflare 提供服务时,它的速度很慢。
我在另一台 PC 上进行了相同的安装(我正在过渡到 linux),它在代理和 CF 后面运行良好。
这是我的 docker-compose.yml
version: '3.7'
services:
server:
image: nginx
restart: always
environment:
- APP_URL=https://URL.co.uk
volumes:
# Vhost configuration
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/default.conf:ro
# Configure your mounted directories, make sure the folder 'public' and 'storage'
# exist, before mounting them
- public:/var/www/app/public
- storage:/var/www/app/storage
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/app/public:/var/www/app/public:rw,delegated
# - ./docker/app/storage:/var/www/app/storage:rw,delegated
depends_on:
- app
# Run webserver nginx on port 80
# Feel free to modify depending what port is already occupied
ports:
- "8000:80"
- "4433:443"
networks:
- invoiceninja
app:
image: invoiceninja/invoiceninja:alpine-4
restart: always
environment:
- APP_URL=https://URL.co.uk
- APP_KEY=XXXXXXXXXXXXXXX
- MULTI_DB_ENABLED=false
- DB_HOST=db
- DB_USERNAME=ninja
- DB_PASSWORD=password123
- DB_DATABASE=ninja
volumes:
# Configure your mounted directories, make sure the folder 'public' and 'storage'
# exist, before mounting them
- public:/var/www/app/public
- storage:/var/www/app/storage
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/app/public:/var/www/app/public:rw,delegated
# - ./docker/app/storage:/var/www/app/storage:rw,delegated
depends_on:
- db
networks:
- invoiceninja
db:
image: mysql:5
restart: always
environment:
- MYSQL_ROOT_PASSWORD=password123
- MYSQL_USER=ninja
- MYSQL_PASSWORD=password123
- MYSQL_DATABASE=ninja
volumes:
- mysql-data:/var/lib/mysql:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/mysql/data:/var/lib/mysql:rw,delegated
networks:
- invoiceninja
# THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
cron:
image: invoiceninja/invoiceninja:alpine-4
volumes:
- storage:/var/www/app/storage
- logo:/var/www/app/public/logo
- public:/var/www/app/public
entrypoint: |
/bin/sh -c 'sh -s <<EOF
trap "break;exit" SIGHUP SIGINT SIGTERM
sleep 300s
while /bin/true; do
./artisan ninja:send-invoices
./artisan ninja:send-reminders
sleep 1d
done
EOF'
networks:
- invoiceninja
volumes:
mysql-data:
public:
storage:
# This is needed for letting th cron run correctly
logo:
networks:
invoiceninja:
我检查了日志,但没有很多人(也许有人可以帮助告诉我如何启用更多日志记录?)我有这个:
172.31.0.2 - 14/Oct/2020:21:38:52 +0000 "GET /index.php" 200
172.31.0.2 - 14/Oct/2020:21:38:55 +0000 "GET /index.php" 404
172.31.0.2 - 14/Oct/2020:21:39:13 +0000 "GET /index.php" 200
172.31.0.2 - 14/Oct/2020:21:39:16 +0000 "GET /index.php" 404
172.31.0.2 - 14/Oct/2020:21:40:06 +0000 "GET /index.php" 302
172.31.0.2 - 14/Oct/2020:21:40:06 +0000 "GET /index.php" 200
172.31.0.2 - 14/Oct/2020:21:40:10 +0000 "GET /index.php" 404
我怀疑 302/404 是问题,但我不知道如何深入研究。
协助将不胜感激。
提前致谢 :)