Update: Nginx server
This commit is contained in:
parent
76906d9b8a
commit
765119685e
40
Dockerfile
40
Dockerfile
@ -36,14 +36,52 @@ WORKDIR /app/wordpress
|
||||
|
||||
RUN wp core download --allow-root
|
||||
|
||||
|
||||
## NGINX
|
||||
## forked : https://git.sindominio.net/estibadores/nginx/src/branch/master/Dockerfile
|
||||
|
||||
RUN apt install -qy nginx-full ssl-cert
|
||||
|
||||
COPY config/nginx.wordpress.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Basic nginx directories
|
||||
RUN mkdir -p /var/lib/nginx/body && \
|
||||
mkdir -p /var/lib/nginx/proxy && \
|
||||
mkdir -p /var/lib/nginx/fastcgi && \
|
||||
mkdir -p /var/lib/nginx/scgi && \
|
||||
mkdir -p /var/lib/nginx/uwsgi && \
|
||||
mkdir -p /var/lib/nginx/ssl/private && \
|
||||
mkdir -p /var/lib/nginx/ssl/certs
|
||||
|
||||
# Copy self-signed certs
|
||||
|
||||
RUN cp /etc/ssl/private/ssl-cert-snakeoil.key /var/lib/nginx/ssl/private/ && \
|
||||
cp /etc/ssl/certs/ssl-cert-snakeoil.pem /var/lib/nginx/ssl/certs/
|
||||
|
||||
RUN sed -i "s:/etc/ssl:/var/lib/nginx/ssl:g" /etc/nginx/snippets/snakeoil.conf
|
||||
|
||||
# Logging to stdout
|
||||
RUN ln -sf /proc/self/fd /dev/
|
||||
RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
||||
|
||||
# PID nginx for non-root users
|
||||
RUN mkdir -p /run/nginx && \
|
||||
chmod 777 /run/nginx && \
|
||||
chmod -R 777 /var/lib/nginx
|
||||
|
||||
ADD wordpress /tmp/wordpress
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
ADD start.sh /start.sh
|
||||
|
||||
|
||||
EXPOSE 9000
|
||||
EXPOSE 443
|
||||
EXPOSE 80
|
||||
|
||||
VOLUME /app
|
||||
|
||||
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
|
||||
|
||||
CMD ["/usr/sbin/php-fpm","--nodaemonize","-O"]
|
||||
#CMD ["/usr/sbin/php-fpm","--nodaemonize","-O"]
|
||||
CMD ["/start.sh"]
|
||||
|
60
config/nginx.wordpress.conf
Normal file
60
config/nginx.wordpress.conf
Normal file
@ -0,0 +1,60 @@
|
||||
worker_processes auto;
|
||||
pid /run/nginx/nginx.pid;
|
||||
error_log stderr info;
|
||||
daemon off;
|
||||
master_process off;
|
||||
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
server_tokens off;
|
||||
|
||||
server_names_hash_bucket_size 128;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
##
|
||||
# SSL Settings
|
||||
##
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log /dev/stdout;
|
||||
|
||||
##
|
||||
# Gzip Settings
|
||||
##
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
|
||||
|
@ -50,9 +50,9 @@ update() {
|
||||
# WP-CLI install
|
||||
# https://www.cloudways.com/blog/install-wordpress-using-wp-cli/
|
||||
|
||||
update
|
||||
#update
|
||||
#install_themes
|
||||
install_plugins
|
||||
#install_plugins
|
||||
|
||||
echo "Starting Wordpress"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user