Add Drupal headless stack with Next.js frontend

- Add Next.js frontend service (nextjs) with Dockerfile and source
- Update docker-compose.yml: image names, Drupal 11.3.3, nextjs service
- Add docker-compose.override.yml.disabled for dev hot-reload
- Add install-headless-modules.sh for OAuth/JSON:API module setup
- Add README.md with full setup and configuration guide
- Update nginx/Dockerfile and nginx.conf.template for cms. subdomain
- Update drupal/Dockerfile PHP-FPM build args
- Gitignore **/.vscode/ to prevent IDE workspace files from being tracked
This commit is contained in:
rnsrk 2026-03-30 11:14:17 +02:00
parent 71a8dac389
commit f8b8f53d54
85 changed files with 7802 additions and 17 deletions

View file

@ -3,6 +3,6 @@ FROM nginx:latest
COPY ./nginx.conf.template /etc/nginx/nginx.conf.template
ARG DOMAIN
RUN sed 's|${DOMAIN}|'"$DOMAIN"'|g' /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
RUN envsubst '${DOMAIN}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
ENTRYPOINT ["nginx", "-g", "daemon off;"]

View file

@ -18,11 +18,21 @@ http {
keepalive_timeout 65;
gzip on;
# Increase client body size for file uploads.
client_max_body_size 64M;
server {
listen 80;
server_name ${DOMAIN};
server_name cms.${DOMAIN};
root /var/www/html;
# JSON:API endpoint caching headers.
location /jsonapi {
try_files $uri /index.php$is_args$args;
add_header Cache-Control "public, max-age=60";
add_header X-Content-Type-Options nosniff;
}
location / {
try_files $uri /index.php$is_args$args;
}
@ -33,9 +43,10 @@ http {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_read_timeout 120;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
@ -45,19 +56,19 @@ http {
rewrite ^ /index.php;
}
# Don't allow direct access to PHP files in the vendor directory
# Don't allow direct access to PHP files in the vendor directory.
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
# Protect files and directories from prying eyes
# Protect files and directories from prying eyes.
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
deny all;
return 404;
}
# Protect .git directory
# Protect .git directory.
location ~ /\.git {
deny all;
return 404;