Public Repository

Last pushed: 9 months ago
Short Description
NGINX with Wordpress
Full Description

Dockerfile

FROM ubuntu
RUN apt-get update;apt-get install -y nginx

#nginx config
ADD nginx.conf /etc/nginx/
RUN rm -rf /etc/nginx/conf.d/*

#ENV Variables
ENV TERM xterm

#Add Wordpress
ADD wordpress.tar /var/www/html
RUN chown -R www-data:www-data /var/www/html


#Startup Script
RUN echo "#!/bin/bash" > /start.sh
RUN chown -R www-data:www-data /var/www/html
RUN echo "nginx" >> /start.sh
RUN chmod +x /start.sh

EXPOSE 443 80
CMD nginx

Nginx Config file

user              www-data;
worker_processes  4;
daemon off;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
worker_connections  1024;
}


http {
include       /etc/nginx/mime.types;
default_type  application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log  /dev/stdout main;
sendfile        on;
keepalive_timeout  65;
#gzip  on;
include /etc/nginx/conf.d/*.conf;


server {
listen       80;
root            /var/www/html;
client_max_body_size 10G;
fastcgi_buffers 64 4k;

rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

index index.php;

location / {
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
try_files $uri $uri/ index.php;
autoindex on;
}

location ~ ^/.git {
deny all;
}

location ~ ^(.+?\.php)(/.*)?$ {
root /var/www/html;
try_files $1 = 404;
include         fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_pass    phpfpm:9001;
}
}
}
Docker Pull Command
Owner
rusher81572

Comments (0)