Open pathros opened 2 years ago
@pathros Hi 👋
I adjusted the base image to the specific version (php:7.4.19-fpm-alpine) I used when I created this project last year. The latest 7.4.27 version used npm 8.1 which, for some reason, caused the issue. If I get some time, I'll try to make it work on the latest patchset version of php fpm alpine.
Try pulling in the latest commit to your local branch and let me know if it works. Thanks!
Hello, @louiepascual !
Thank you so much! Now the building is working:
Successfully built b474e5a... Successfully tagged ojs-nginx:latest
After running it, I get the error 502 bad gateway
.
What could be the problem?
In the docker-compose.yml
file, the app container name is ojs_app
.
ojs_nginx:
container_name: ojs_nginx
expose:
- "80"
# ports:
# - 8080:8080
And in the nginx.conf
file I got
listen 80;
listen [::]:80;
server_name myOwnDomain;
...
location ~ ^(.+\.php)(.*)$ {
fastcgi_pass ojs_app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
#fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
#fastcgi_param PATH_INFO $fastcgi_path_info;
}
My docker-compose logs say everything is ok:
ojs_db | 2022-02-19 18:17:40 140433793791680 [Note] mysqld: ready for connections. ojs_app | [19-Feb-2022 18:17:32] NOTICE: fpm is running, pid 1 ojs_app | [19-Feb-2022 18:17:32] NOTICE: ready to handle connections ojs_nginx | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration ojs_nginx | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ ojs_nginx | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh ojs_nginx | 10-listen-on-ipv6-by-default.sh: Getting the checksum of /etc/nginx/conf.d/default.conf ojs_nginx | 10-listen-on-ipv6-by-default.sh: error: /etc/nginx/conf.d/default.conf differs from the packages version ojs_nginx | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh ojs_nginx | /docker-entrypoint.sh: Configuration complete; ready for start up
And still I see the 502 error:
502 Bad Gateway Nginx
Any ideas what I'm missing?
Usually this means that nginx is not connecting to php-fpm (ojs_app) properly. So if the php-fpm is running, likely there's some issue with the nginx.conf. There should be logs in docker-compose that will point you to the issue. Or maybe try using the nginx.conf that was also included in this repo.
Regarding your docker-compose config, have you tried setting the ports to 80:80? I haven't tried it but using expose only opens the container port but won't really connect it to a host port.
I'll check it out ...
Meanwhile, I am testing it on Docker desktop at my computer.
So far so good with the image building.
So I open the OJS with http://localhost:8080/index.php/index/install/install
After giving the default DB credentials (everything ojs
), I got the following error:
A database error has occurred: SQLSTATE[HY000] [2002] No such file or directory (SQL: create table
announcement_types
(type_id
bigint not null auto_increment primary key,assoc_type
smallint not null,assoc_id
bigint not null) default character set utf8 collate 'utf8_general_ci')
Also the warning message
Your server currently allows file uploads: No
Any ideas how to overcome them?
Hello!
When I execute
docker build -t ojs-nginx:latest .
, I get the following error:Any ideas how to fix this?