Skip to content

Commit

Permalink
Merge pull request #26 from RunOnFlux/develop
Browse files Browse the repository at this point in the history
Redis support + WP core stability
  • Loading branch information
alihm authored Apr 29, 2024
2 parents f8ef38f + 8b2370c commit 3a5d4f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,8 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp

# Configure SSH server for SFTP and key-based authentication
#RUN mkdir /var/run/sshd \
# && sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config \
# && sed -i 's/#Port 22/Port 2222/' /etc/ssh/sshd_config \
# && sed -i 's/#AuthorizedKeysFile/AuthorizedKeysFile/' /etc/ssh/sshd_config \
# && sed -i 's/^Subsystem\s\+sftp\s\+\/usr\/lib\/openssh\/sftp-server/Subsystem sftp internal-sftp/' /etc/ssh/sshd_config \
# && echo 'Match User sftpuser\nChrootDirectory /var/www/%u\nForceCommand internal-sftp\nX11Forwarding no\nAllowTcpForwarding no' >> /etc/ssh/sshd_config

# Install Redis server package
RUN apt-get install -y redis-server

#Configure SSH server
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
Expand Down Expand Up @@ -208,4 +202,4 @@ EXPOSE 2222/tcp

ENTRYPOINT ["/usr/local/docker-entrypoint.sh"]
# Start PHP-FPM and Nginx servers
CMD /usr/local/php-fpm.sh & nginx -g "daemon off;" -c "/var/www/html/nginx.conf" & /usr/sbin/sshd -D
CMD /usr/local/php-fpm.sh & nginx -g "daemon off;" -c "/var/www/html/nginx.conf" & /usr/sbin/sshd -D & redis-server
6 changes: 5 additions & 1 deletion wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ function getenv_docker( $env, $default ) {
//Disable WP_AUTO_UPDATE_CORE on slave nodes
define( 'WP_AUTO_UPDATE_CORE', false );
}

if ( $is_slave ) {
header('HTTP/1.1 503 Service Unavailable');
echo 'Standby node. Runs on <a href="https://runonflux.io">Flux</a>';
exit(0);
}
// If we're behind a proxy server and using HTTPS, we need to alert WordPress of that fact
// see also https://wordpress.org/support/article/administration-over-ssl/#using-a-reverse-proxy
if ( !empty( $_SERVER['HTTP_HOST'] ) || $_SERVER['REMOTE_ADDR'] === '127.0.0.1' ) {
Expand Down

0 comments on commit 3a5d4f6

Please sign in to comment.