Compare commits

...

6 Commits

5 changed files with 51 additions and 10 deletions
+14 -4
View File
@@ -7,17 +7,27 @@
# ignora tudo dentro de wp-content # ignora tudo dentro de wp-content
/webroot/wp-content/* /webroot/wp-content/*
# permite o que é seu # permite as pastas (mas não o conteúdo delas)
!/webroot/wp-content/plugins/ !/webroot/wp-content/plugins/
!/webroot/wp-content/themes/ !/webroot/wp-content/themes/
!/webroot/wp-content/mu-plugins/ !/webroot/wp-content/mu-plugins/
# permite arquivos específicos se precisar /webroot/wp-content/plugins/*
!/webroot/wp-content/plugins/seu-plugin/ /webroot/wp-content/themes/*
!/webroot/wp-content/themes/seu-tema/ /webroot/wp-content/mu-plugins/*
# permite o .gitkeep para que a pasta vazia seja versionada
!/webroot/wp-content/plugins/.gitkeep
!/webroot/wp-content/themes/.gitkeep
!/webroot/wp-content/mu-plugins/.gitkeep
# se no futuro quiser versionar algo específico:
# !/webroot/wp-content/themes/seu-tema/
# !/webroot/wp-content/themes/seu-tema/**
# regras gerais # regras gerais
.DS_Store .DS_Store
.env .env
vendor vendor
node_modules node_modules
docker-compose.override.yml
+15
View File
@@ -0,0 +1,15 @@
#
# uncoment volumes below to bind specif plugins and themes from other paths into your project
# copy this file as 'docker-compose.override.yml' for autoloading with docker-compose.yml
#
services:
reverse-proxy:
# volumes:
# - ../repo/wp-content/themes/my-theme:/var/www/html/wp-content/themes/my-theme
# - ../repo/wp-content/plugins/my-plugin:/var/www/html/wp-content/plugins/my-plugin
app:
# volumes:
# - ../repo/wp-content/themes/my-theme:/var/www/html/wp-content/themes/my-theme
# - ../repo/wp-content/plugins/my-plugin:/var/www/html/wp-content/plugins/my-plugin
+7 -4
View File
@@ -3,7 +3,7 @@ name: ${WPSTACK_PROJECT_NAME:-wpstack}
services: services:
reverse-proxy: reverse-proxy:
container_name: reverse-proxy container_name: ${WPSTACK_PROJECT_NAME:-wpstack}-reverse-proxy
image: hackeamos/httpd image: hackeamos/httpd
build: build:
context: './docker/nginx' context: './docker/nginx'
@@ -14,6 +14,7 @@ services:
environment: environment:
WORDPRESS_SITEURL: ${WPSTACK_PROTOCOL}://${WPSTACK_DOMAIN}/${WPSTACK_URLPATH:-} WORDPRESS_SITEURL: ${WPSTACK_PROTOCOL}://${WPSTACK_DOMAIN}/${WPSTACK_URLPATH:-}
WORDPRESS_SITE_TYPE: ${WPSTACK_MULTISITE:-regular} WORDPRESS_SITE_TYPE: ${WPSTACK_MULTISITE:-regular}
REMOTE_MEDIA_URL: ${REMOTE_MEDIA_URL:-}
labels: labels:
caddy: ${WPSTACK_DOMAIN} caddy: ${WPSTACK_DOMAIN}
caddy.reverse_proxy: "reverse-proxy:80" caddy.reverse_proxy: "reverse-proxy:80"
@@ -23,7 +24,7 @@ services:
- proxy-network - proxy-network
app: app:
container_name: app container_name: ${WPSTACK_PROJECT_NAME:-wpstack}-app
image: hackeamos/wp image: hackeamos/wp
build: build:
context: . context: .
@@ -31,10 +32,11 @@ services:
volumes: volumes:
- ./webroot:/var/www/html - ./webroot:/var/www/html
environment: environment:
WORDPRESS_DB_HOST: db WORDPRESS_DB_HOST: ${WPSTACK_PROJECT_NAME:-wpstack}-db
WORDPRESS_DB_USER: ${DB_USER} WORDPRESS_DB_USER: ${DB_USER}
WORDPRESS_DB_NAME: ${DB_NAME} WORDPRESS_DB_NAME: ${DB_NAME}
WORDPRESS_DB_PASSWORD: ${DB_PASS} WORDPRESS_DB_PASSWORD: ${DB_PASS}
WORDPRESS_TABLE_PREFIX: ${DB_PREFIX:-wp_}
WORDPRESS_SITEURL: ${WPSTACK_PROTOCOL}://${WPSTACK_DOMAIN}/${WPSTACK_URLPATH:-} WORDPRESS_SITEURL: ${WPSTACK_PROTOCOL}://${WPSTACK_DOMAIN}/${WPSTACK_URLPATH:-}
WORDPRESS_BLOGNAME: ${WPSTACK_BLOGNAME:-} WORDPRESS_BLOGNAME: ${WPSTACK_BLOGNAME:-}
WORDPRESS_ADMIN_USER: ${WPSTACK_ADMIN_USER:-admin} WORDPRESS_ADMIN_USER: ${WPSTACK_ADMIN_USER:-admin}
@@ -51,10 +53,11 @@ services:
- proxy-network - proxy-network
db: db:
container_name: db container_name: ${WPSTACK_PROJECT_NAME:-wpstack}-db
image: mariadb image: mariadb
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
- ../db:/docker-entrypoint-initdb.d
environment: environment:
MARIADB_RANDOM_ROOT_PASSWORD: true MARIADB_RANDOM_ROOT_PASSWORD: true
MARIADB_USER: ${DB_USER} MARIADB_USER: ${DB_USER}
@@ -28,6 +28,19 @@ server {
access_log off; access_log off;
} }
location ~ ^/wp-content/uploads/(.*)$ {
try_files $uri @remote_assets;
}
location @remote_assets {
set $remote_url "${REMOTE_MEDIA_URL}";
if ($remote_url = "") {
return 404;
}
add_header X-Redirect-From "nginx-local" always;
return 302 $remote_url$request_uri;
}
location / { location / {
# This is cool because no php is touched for static content. # This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string # include the "?$args" part so non-default permalinks doesn't break when using query string
@@ -23,5 +23,5 @@ if which wp && ! wp core is-installed; then
fi fi
if test "$(wp theme list --format=count)" = "0"; then if test "$(wp theme list --format=count)" = "0"; then
wp theme install ${WORDPRESS_DEFAULT_THEME:-twentytwentysix} --force --activate; wp theme install ${WORDPRESS_DEFAULT_THEME:-twentytwentyfive} --force --activate;
fi fi