fix(docker): scope build context to docker/ so it builds standalone (#7513)

COPY docker/apache.conf and docker/entrypoint.sh only resolve when the
build context is the repo root. Building directly from docker/ (docker
build .) fails because those paths don't exist relative to that
context. Neither COPY step needs anything outside docker/, so narrow
the context instead of requiring root.

Fixes #7512

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
This commit is contained in:
Thomas VincentandTheWitness authored and GitHub committed 2026-08-05 10:21:03 -04:00
1 parent 1a17a6f176
commit 5d90e579e2
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@
services: services:
web: web:
build: build:
context: . context: ./docker
dockerfile: docker/Dockerfile dockerfile: Dockerfile
container_name: cacti_web container_name: cacti_web
ports: ports:
- "${WEB_PORT:-8080}:80" - "${WEB_PORT:-8080}:80"
+2 -2
View File
@@ -34,7 +34,7 @@ RUN a2enmod rewrite headers proxy proxy_fcgi setenvif \
&& a2dismod mpm_prefork \ && a2dismod mpm_prefork \
&& a2enmod mpm_event && a2enmod mpm_event
COPY docker/apache.conf /etc/apache2/sites-available/cacti.conf COPY apache.conf /etc/apache2/sites-available/cacti.conf
RUN a2dissite 000-default && a2ensite cacti RUN a2dissite 000-default && a2ensite cacti
# Static PHP settings (runtime-tunable values are set in entrypoint.sh) # Static PHP settings (runtime-tunable values are set in entrypoint.sh)
@@ -72,7 +72,7 @@ RUN mkdir -p /var/www/html/cacti/cache \
/var/www/html/cacti/log \ /var/www/html/cacti/log \
&& chown -R www-data:www-data /var/www/html/cacti && chown -R www-data:www-data /var/www/html/cacti
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh
# App code comes from the docker-compose bind mount, not from this image. # App code comes from the docker-compose bind mount, not from this image.