我正在使用docker compose向服务器添加自托管的开源CRM。
在不添加volumes
的情况下运行时,CRM运行良好,当我添加卷并访问页面时,出现错误:
Network Error
Could not read authentication system settings (//server_ip:8081/system/auth/). Inspect your settings or contact your IT team.
Settings:
System API URL //server_ip:8081/system
Compose API URL //server_ip:8081/compose
Messaging API URL //server_ip8:8081/messaging
我的文件
docker-compose.yaml
version: '3.5'
services:
db:
image: percona:8.0
restart: on-failure
environment:
MYSQL_DATABASE: corteza
MYSQL_USER: corteza
MYSQL_PASSWORD: pswd
MYSQL_ROOT_PASSWORD: rootpswd
healthcheck: { test: ["CMD", "mysqladmin" ,"ping", "-h", "Server_IP"], timeout: 20s, retries: 10 }
volumes: [ "./data/db:/var/lib/mysql" ]
server:
image: cortezaproject/corteza-server-monolith:latest
restart: on-failure
env_file: [ .env ]
environment:
CORREDOR_API_BASE_URL_SYSTEM: "Server_IP:80/system"
CORREDOR_API_BASE_URL_MESSAGING: "Server_IP:80/messaging"
CORREDOR_API_BASE_URL_COMPOSE: "Server_IP:80/compose"
CORREDOR_ADDR: "corredor:${LOCAL_DEMO_CRD_PORT}"
depends_on: [ db, corredor ]
ports: [ "Server_IP:${LOCAL_DEMO_API_PORT}:80" ]
volumes: [ "./data/server:/data" ]
corredor:
image: cortezaproject/corteza-server-corredor:latest
restart: on-failure
env_file: [ .env ]
environment:
CORREDOR_ADDR: "corredor:${LOCAL_DEMO_CRD_PORT}"
ports: [ "Server_IP:${LOCAL_DEMO_CRD_PORT}:50051" ]
webapp:
image: cortezaproject/corteza-webapp:latest
restart: on-failure
depends_on: [ server ]
environment:
MONOLITH_API: 1
API_BASEURL: "Server_IP:${LOCAL_DEMO_API_PORT}"
ports: [ "Server_IP:${LOCAL_DEMO_SPA_PORT}:80" ]
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
restart: always
ports:
- "81:80"
- "444:443"
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
volumes:
- ./certs:/etc/nginx/certs
- ./htpasswd:/etc/nginx/htpasswd
- ./vhost.d:/etc/nginx/vhost.d
- ./html:/usr/share/nginx/html
- ./custom.conf:/etc/nginx/conf.d/custom.conf:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-letsencrypt
restart: always
depends_on:
- nginx-proxy
volumes:
- ./certs:/etc/nginx/certs
- ./vhost.d:/etc/nginx/vhost.d
- ./html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
.env文件
VERSION=2020.6
DB_DSN=corteza:rootpswd@tcp(db:3306)/corteza?collation=utf8mb4_general_ci
AUTH_JWT_SECRET=.......
LOCAL_DEMO_SPA_PORT=8080
LOCAL_DEMO_API_PORT=8081
LOCAL_DEMO_CRD_PORT=8082
# SMTP settings
SMTP_HOST=xxx
SMTP_USER=xxx
SMTP_PASS=xxx
SMTP_FROM=xxx
---------------------------------------------- Docker检查- --------------------------------------------------
#docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------------
dockercomposefile_corredor_1 /corredor/node_modules/.bi ... Up server_port:8082->50051/tcp, 80/tcp
dockercomposefile_db_1 /docker-entrypoint.sh mysqld Restarting
dockercomposefile_server_1 /corteza/bin/server serve-api Exit 0
dockercomposefile_webapp_1 /entrypoint.sh Up server_port:8080->80/tcp
nginx-letsencrypt /bin/bash /app/entrypoint. ... Up
nginx-proxy /app/docker-entrypoint.sh ... Restarting
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4d38bedd37de cortezaproject/corteza-webapp:latest "/entrypoint.sh" 15 minutes ago Up 14 minutes (healthy) server_port:8080->80/tcp dockercomposefile_webapp_1
988b56c6c097 jrcs/letsencrypt-nginx-proxy-companion "/bin/bash /app/entr…" 15 minutes ago Up 15 minutes nginx-letsencrypt
e711d5700259 jwilder/nginx-proxy "/app/docker-entrypo…" 15 minutes ago Restarting (0) 44 seconds ago nginx-proxy
2e174c43e361 percona:8.0 "/docker-entrypoint.…" 15 minutes ago Restarting (1) 40 seconds ago dockercomposefile_db_1
aa1066533c41 cortezaproject/corteza-server-corredor:latest "/corredor/node_modu…" 15 minutes ago Up 15 minutes (unhealthy) 80/tcp, server_port:8082->50051/tcp dockercomposefile_corredor_1
------------------------------------日志文件--------- -------------------------------
cortezaproject / corteza-server-monolith(已停止)
{"level":"warn","ts":1594843456.5513225,"logger":"database","caller":"db/connector.go:66","msg":"could not connect to the database","name":"default","error":"dial tcp: lookup db on 127.0.0.11:53: no such host","errorVerbose":"dial tcp: lookup db on 127.0.0.11:53: no such host\ngithub.com/titpetric/factory.(*DatabaseFactory).Get\n\t/drone/src/vendor/github.com/titpetric/factory/database.go:142\ngithub.com/cortezaproject/corteza-server/pkg/db.TryToConnect.func1\n\t/drone/src/pkg/db/connector.go:64\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373","try":12,"dsn":"c****a:e****]@tcp(db:3306)/corteza?collation=utf8mb4_general_ci","delay":5}
Error: could not connect to database: db init for "default" timedout
Usage:
corteza-server serve-api [flags]
Aliases:
serve-api, serve
Flags:
-h, --help help for serve-api
jwilder / nginx-proxy(已停止)
nginx.1 | 2020/07/15 20:19:39 [crit] 31#31: pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
nginx.1 | nginx: [crit] pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
forego | starting nginx.1 on port 5200
forego | sending SIGTERM to nginx.1
forego | sending SIGTERM to dockergen.1
forego | starting dockergen.1 on port 5000
forego | starting nginx.1 on port 5100
nginx.1 | 2020/07/15 20:20:40 [crit] 29#29: pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
forego | starting nginx.1 on port 5200
forego | sending SIGTERM to nginx.1
forego | sending SIGTERM to dockergen.1
forego | starting dockergen.1 on port 5000
forego | starting nginx.1 on port 5100
nginx.1 | 2020/07/15 20:21:41 [crit] 28#28: pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
nginx.1 | nginx: [crit] pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
forego | starting nginx.1 on port 5200
nginx.1 | 2020/07/15 20:21:41 [crit] 35#35: pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
forego | sending SIGTERM to nginx.1
forego | sending SIGTERM to dockergen.1
forego | starting dockergen.1 on port 5000
forego | starting nginx.1 on port 5100
nginx.1 | 2020/07/15 20:22:42 [crit] 29#29: pread() "/etc/nginx/conf.d/custom.conf" failed (21: Is a directory)
forego | starting nginx.1 on port 5200
forego | sending SIGTERM to nginx.1
forego | sending SIGTERM to dockergen.1
Percona(已停止)
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2020-07-15T20:24:52.479361Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2020-07-15T20:24:52.479490Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19-10) starting as process 1
2020-07-15T20:24:52.483199Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2020-07-15T20:24:52.483212Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2020-07-15T20:24:52.483834Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-07-15T20:24:52.484179Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19-10) Percona Server (GPL), Release 10, Revision f446c04.
Nginx-Letsencrypt(正在运行)
2020/07/15 20:25:46 Received event start for container e711d5700259
2020/07/15 20:25:46 Received event die for container e711d5700259
2020/07/15 20:25:53 Received event start for container 2e174c43e361
2020/07/15 20:25:54 Received event die for container 2e174c43e361
2020/07/15 20:26:09 Debounce minTimer fired
2020/07/15 20:26:09 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
dockercomposefile_webapp_1(正在运行)
{"@timestamp":"2020-07-15T20:09:32+00:00","remote_addr":"86.2.219.92","request":"GET /auth/config.js HTTP/1.1","status":200,"body_bytes_sent":152,"request_time":0.000,"http_referrer":"http://server_ip:8080/auth/login","http_user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"}
{"@timestamp":"2020-07-15T20:13:24+00:00","remote_addr":"127.0.0.1","request":"GET /config.js HTTP/1.1","status":200,"body_bytes_sent":152,"request_time":0.000,"http_referrer":"","http_user_agent":"Wget"}
dockercomposefile_corredor_1(正在运行)
{"level":30,"time":1594843405819,"name":"check","msg":"server-scripts service configured","v":1}
{"level":30,"time":1594843405820,"name":"check","output":"/tmp/corredor/bundler-dist","msg":"making bundler output directory","v":1}
{"level":30,"time":1594843405821,"name":"services.dependencies","msg":"initializing watcher","v":1}
{"level":30,"time":1594843405838,"name":"services.server-scripts","searchPaths":["/extensions/*","/corredor/usr/*","/corredor/usr"],"msg":"reloading server scripts","v":1}
{"level":30,"time":1594843405897,"name":"services.client-scripts","searchPaths":["/extensions/*","/corredor/usr/*","/corredor/usr"],"msg":"reloading client scripts","v":1}
{"level":30,"time":1594843407370,"name":"services.client-scripts","valid":19,"total":19,"msg":"processed","v":1}
{"level":30,"time":1594843410742,"name":"services.server-scripts","valid":14,"total":14,"msg":"processed","v":1}
{"level":30,"time":1594843410785,"name":"gRPC","msg":"server running at corredor:8082","v":1}
我已将/ var / lib / docker / Dockercomposefile中的文件的权限设置为mysql 除了docker-compose.yaml和.env设置为root以外。
文件夹权限也设置为777
以前,所有设置为root的文件仍然无法工作
任何帮助将不胜感激。