Open Yanom1212 opened 2 years ago
The php-fpm and nginx containers need to point to the same public directory:
version: "3.4"
services:
database:
image: mariadb
restart: always
environment:
MYSQL_DATABASE: panel
MYSQL_USER: admin
MYSQL_PASSWORD: Password
MYSQL_RANDOM_ROOT_PASSWORD: "no"
volumes:
- /volume2/docker/pterodactyl-node/db/:/var/lib/mysql
cache:
image: redis
restart: always
php-fpm:
image: joshuawalsh/pterodactyl-panel
restart: always
depends_on:
- database
volumes:
- /volume2/docker/pterodactyl-node/app/:/var/www/html/
- /volume2/docker/pterodactyl-node/storage/:/var/www/html/storage/
- /volume2/docker/pterodactyl-node/public/:/var/www/html/public/
environment:
DB_HOST: database
DB_PORT: 3306
DB_DATABASE: panel
DB_USERNAME: admin
DB_PASSWORD: Password
nginx:
image: joshuawalsh/nginx-for-php-fpm
restart: always
depends_on:
- php-fpm
ports:
- 5080:80
volumes:
- /volume2/docker/pterodactyl-node/public/:/var/www/html/
I having the same problem but my containers are pointing to the same public directory.
version: "3.4"
services:
database:
image: mariadb
restart: unless-stopped
environment:
MYSQL_DATABASE: panel
MYSQL_USER: pterodactyl
MYSQL_PASSWORD: password
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
volumes:
- /opt/configs/pterodactyl-db:/var/lib/mysql
cache:
image: redis
restart: unless-stopped
php-fpm:
image: joshuawalsh/pterodactyl-panel
restart: unless-stopped
depends_on:
- database
volumes:
- /mnt/pool/pterodactyl/app:/var/www/html/
- /mnt/pool/pterodactyl/storage:/var/www/html/storage/
- /mnt/pool/pterodactyl/public:/var/www/html/public/
environment:
DB_HOST: database
DB_PORT: 3310
DB_DATABASE: panel
DB_USERNAME: pterodactyl
DB_PASSWORD: password
nginx:
image: joshuawalsh/nginx-for-php-fpm
restart: unless-stopped
depends_on:
- php-fpm
ports:
- 5080:80
volumes:
- /mnt/pool/pterodactyl/public:/var/www/html/
volumes:
public:
db:
storage:
app:
@jfgodin I haven't been able to reproduce this issue. Could you try doing it using Docker volumes instead of mounts?
version: "3.4"
services:
database:
image: mariadb
restart: unless-stopped
environment:
MYSQL_DATABASE: panel
MYSQL_USER: pterodactyl
MYSQL_PASSWORD: password
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
volumes:
- db:/var/lib/mysql
cache:
image: redis
restart: unless-stopped
php-fpm:
image: joshuawalsh/pterodactyl-panel
restart: unless-stopped
depends_on:
- database
volumes:
- app:/var/www/html/
- storage:/var/www/html/storage/
- public:/var/www/html/public/
environment:
DB_HOST: database
DB_PORT: 3310
DB_DATABASE: panel
DB_USERNAME: pterodactyl
DB_PASSWORD: password
nginx:
image: joshuawalsh/nginx-for-php-fpm
restart: unless-stopped
depends_on:
- php-fpm
ports:
- 5080:80
volumes:
- public:/var/www/html/
volumes:
public:
db:
storage:
app:
If this helps, the issue might be with file permissions.
So that solved the missing file issue (thanks!) but now FPM has a timeout error and nginx has a connection refuse error. 🤣
Have you made any changes to the compose file I posted? That one works for me.
E.g. If you change the name of the "php-fpm" container it will fail, because the "nginx" container looks for that name.
Otherwise, is there anything in the log of the php-fpm container?
The only change was the password and adding the port to the DB. The error log for the php-fpm container is only:
Operation timed out
NGINX log is:
2021/11/22 22:44:37 [error] 9#9: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.101, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.16.3:9000", host: "192.168.1.100:5080"
Thanks!
docker-compose : version: "3.4" services: database: image: mariadb restart: always environment: MYSQL_DATABASE: panel MYSQL_USER: admin MYSQL_PASSWORD: Password MYSQL_RANDOM_ROOT_PASSWORD: "no" volumes: