Commit 782dcfe0 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Move /wp-content/uploads/ to /media/

parent 174d4c9f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ COPY wp.sh /usr/local/bin/wp
COPY --from=compile /usr/local/etc/php /usr/local/etc/php
COPY --from=compile /usr/local/lib/php /usr/local/lib/php
RUN wp core download --skip-content --locale=en_GB --version=${wp_version} \
 && mkdir -p wp-content/uploads && chmod go+w wp-content/uploads
 && mkdir -p media && chmod go+w media

COPY opcache.ini /usr/local/etc/php/conf.d/opcache-recommended.ini
COPY entrypoint.sh /bin/entrypoint
+7 −1
Original line number Diff line number Diff line
@@ -52,6 +52,12 @@ create_config()
	<<-END_CONFIG
		define('DISALLOW_FILE_MODS', true);

		/*
		 * Move the uploads volume/directory into the top of the Wordpress 
		 * installation.
		 */
		define('UPLOADS', 'media');

		/* BEGIN WP_CONFIG_LINES */
		${WP_CONFIG_LINES[*]}
		/* END WP_CONFIG_LINES */
@@ -98,7 +104,7 @@ collect_static()
		--exclude-from=- \
		--exclude='*.php' \
		--exclude=static/ \
		--exclude=wp-content/uploads/ \
		--exclude=media/ \
		--force \
		--info="${flags[*]}" \
		--noatime \
+41 −41
Original line number Diff line number Diff line
@@ -66,11 +66,12 @@ server {
		location ~ \.php {
			return 404;
		}
	}

		# limit the usefulness of malicious HTML/JS hosted in 
		# /wp-content/uploads by serving only media & common data files with 
		# their correct mime-type
		location /wp-content/uploads/ {
	# limit the usefulness of malicious HTML/JS hosted in /media/ by serving 
	# only media & common data files with their correct mime-type
	location /media/ {
		root /app;
		default_type application/octet-stream;
		types {
			# images #
@@ -113,4 +114,3 @@ server {
		}
	}
}
}