R
Railwayā€¢9mo ago
mjak

Wordpress Application Error (Dockerfile + 6.4.3-fpm)

Please help I need to deploy many Wordpress installs for a migration and I was consideirng using Railway but struggling just to get a simple Dockerfile + Repo setup going (this is needed to copy across the wp-content etc afaik) (CC @Jack as I know you've done a few WP Templates on Railway so I'd appreciate your help) I'm getting Application failed to respond I'm not sure if I need to do anything around putting the apache2-foreground entrypoint here The Dockerfile is really simple for now just
FROM wordpress:6.4.3-php8.3-fpm-alpine
FROM wordpress:6.4.3-php8.3-fpm-alpine
I've defined all the Env Vars using service Variables in the Repo Service.
Project ID: d7998c4d-22a2-4b65-9f46-34e8ebdc4711 Deploy Logs:
WordPress not found in /var/www/html - copying now...

Complete! WordPress has been successfully copied to /var/www/html

No 'wp-config.php' found in /var/www/html, but 'WORDPRESS_...' variables supplied; copying 'wp-config-docker.php' (WORDPRESS_AUTH_KEY WORDPRESS_AUTH_SALT WORDPRESS_CONFIG_EXTRA WORDPRESS_DB_HOST WORDPRESS_DB_NAME WORDPRESS_DB_PASSWORD WORDPRESS_DB_USER WORDPRESS_LOGGED_IN_KEY WORDPRESS_LOGGED_IN_SALT WORDPRESS_NONCE_KEY WORDPRESS_NONCE_SALT WORDPRESS_SECURE_AUTH_KEY WORDPRESS_SECURE_AUTH_SALT)

[23-Feb-2024 05:45:41] NOTICE: fpm is running, pid 7

[23-Feb-2024 05:45:41] NOTICE: ready to handle connections
WordPress not found in /var/www/html - copying now...

Complete! WordPress has been successfully copied to /var/www/html

No 'wp-config.php' found in /var/www/html, but 'WORDPRESS_...' variables supplied; copying 'wp-config-docker.php' (WORDPRESS_AUTH_KEY WORDPRESS_AUTH_SALT WORDPRESS_CONFIG_EXTRA WORDPRESS_DB_HOST WORDPRESS_DB_NAME WORDPRESS_DB_PASSWORD WORDPRESS_DB_USER WORDPRESS_LOGGED_IN_KEY WORDPRESS_LOGGED_IN_SALT WORDPRESS_NONCE_KEY WORDPRESS_NONCE_SALT WORDPRESS_SECURE_AUTH_KEY WORDPRESS_SECURE_AUTH_SALT)

[23-Feb-2024 05:45:41] NOTICE: fpm is running, pid 7

[23-Feb-2024 05:45:41] NOTICE: ready to handle connections
23 Replies
Percy
Percyā€¢9mo ago
Project ID: d7998c4d-22a2-4b65-9f46-34e8ebdc4711
mjak
mjakā€¢9mo ago
I noticed this which seems to be doing some things around:
RUN echo "ServerName 0.0.0.0" >> /etc/apache2/apache2.conf
RUN echo "DirectoryIndex index.php index.html" >> /etc/apache2/apache2.conf
CMD ["apache2-foreground"]
RUN echo "ServerName 0.0.0.0" >> /etc/apache2/apache2.conf
RUN echo "DirectoryIndex index.php index.html" >> /etc/apache2/apache2.conf
CMD ["apache2-foreground"]
but my deploy shows it's "Working"
[23-Feb-2024 05:45:41] NOTICE: fpm is running, pid 7

[23-Feb-2024 05:45:41] NOTICE: ready to handle connections
[23-Feb-2024 05:45:41] NOTICE: fpm is running, pid 7

[23-Feb-2024 05:45:41] NOTICE: ready to handle connections
https://github.com/jdjjd6262/G5gffttccyy/blob/main/Dockerfile A template which enables a default WP + wp-content etc setup would be really wonderful. They all seem to be different apprioaches, with MariaDB etc. so am figuring it out from scratch (Also best way to learn maybe)
Brody
Brodyā€¢9mo ago
jack's wordpress templates have a PORT service variable set to 80 have you tried this?
mjak
mjakā€¢9mo ago
oh no maybe I didn't see that let me try it, thanks for the quick reply
mjak
mjakā€¢9mo ago
No description
mjak
mjakā€¢9mo ago
Maybe I also make a template of this when i'm done
Brody
Brodyā€¢9mo ago
may i ask what does your would do differently/better than jacks?
Brody
Brodyā€¢9mo ago
yes, seems the icon is missing haha, but besides that
mjak
mjakā€¢9mo ago
yeah tbh the icon put me off slightly like (maybe this is broken) and the Docs have some n8n placeholder text probably a copy paste of a Readme Immediately when I saw MariaDB given that I'm going to be migrating many domains over from MySQL I felt I didn't want that headache But I agree it looks solid I'm still getting Application failed to respond after a re-deploy
mjak
mjakā€¢9mo ago
No description
mjak
mjakā€¢9mo ago
Things like DB_HOST are configured with ${{MySQL.MYSQLHOST}}:${{MySQL.MYSQLPORT}}
Brody
Brodyā€¢9mo ago
he used an image from the discord cdn it seems šŸ«¤ where is there mention of n8n?
mjak
mjakā€¢9mo ago
https://railway.app/template/4PQQcM?referralCode=fKo7dw
n8n is an extendable workflow automation tool. With a GNU Public License, an open-source software license that provides legal protection for the CMS and its derivative work, such as themes and plugins. WordPress empowers you to effortlessly create, manage, and customize stunning websites, making it the ultimate content management solution.
n8n is an extendable workflow automation tool. With a GNU Public License, an open-source software license that provides legal protection for the CMS and its derivative work, such as themes and plugins. WordPress empowers you to effortlessly create, manage, and customize stunning websites, making it the ultimate content management solution.
Brody
Brodyā€¢9mo ago
thats funny, it was a quick template spun up to help a user migrate from a dockerfile wordpress deploy to a image deploy
mjak
mjakā€¢9mo ago
Maybe it has something to do with the docker image Perhaps I should just go with wordpress:latest as your templates seem to use but I'd prefer to version lock
Brody
Brodyā€¢9mo ago
you can version lock, whats your start command though?
mjak
mjakā€¢9mo ago
ah I have nothing there šŸ˜¦ somehow assumed that was npm related
Brody
Brodyā€¢9mo ago
try the same start command jack's template has, the template with the missing icon
mjak
mjakā€¢9mo ago
yeah I just deployed the template and I'm going to go over everything sorry yeah it was that /bin/bash -c "echo 'ServerName 0.0.0.0' >> /etc/apache2/apache2.conf && echo 'DirectoryIndex index.php index.html' >> /etc/apache2/apache2.conf && echo 'upload_max_filesize = 50M' >> /usr/local/etc/php/php.ini && echo 'post_max_size = 50M' >> /usr/local/etc/php/php.ini && docker-entrypoint.sh apache2-foreground"
Brody
Brodyā€¢9mo ago
can you not restore a mysql database to a maria database?
mjak
mjakā€¢9mo ago
The other reason to not use Jack's repo was that I needed the wordpress install to be able to run locally with a DB connection to the staging env in Railway DB so that when changes are pushed locally to staging branches CI/CD can take care of the rest The impression I got from the Template was that it was loading the Docker image from the registry And I wasn't sure how I would extend this to COPY wp-content into the container (perhaps I'm missing something here)
/bin/bash: line 1: /etc/apache2/apache2.conf: No such file or directory
/bin/bash: line 1: /etc/apache2/apache2.conf: No such file or directory
OK so It appears I need to use the same docker verison. The apache2.conf may not be available in the image I am using ok thanks Brody! It's up and running FROM wordpress:6.4.3-php8.3-fpm-alpine This didn't work with that start command the start command appears to depend on -apache2 tagged images Thank you for the great questions! šŸ¦†šŸ™Œ
Brody
Brodyā€¢9mo ago
happy to help where i can!
Want results from more Discord servers?
Add your server