Files
Netbox-Store/store/Dockerfile
T
MrBlake f36d6be511
CI / php-store (push) Waiting to run
CI / python-components (push) Waiting to run
feat: add NetBox plugin store
2026-08-24 20:51:25 +02:00

28 lines
1.3 KiB
Docker

FROM composer:2 AS vendor
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-interaction --no-progress --prefer-dist --optimize-autoloader \
--ignore-platform-req=ext-curl --ignore-platform-req=ext-dom --ignore-platform-req=ext-iconv --ignore-platform-req=ext-intl \
--ignore-platform-req=ext-mbstring --ignore-platform-req=ext-pdo
FROM php:8.4-apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends libcurl4-openssl-dev libicu-dev libonig-dev libxml2-dev util-linux \
&& docker-php-ext-install -j"$(nproc)" curl dom intl mbstring opcache pcntl pdo_mysql \
&& a2enmod rewrite headers expires \
&& rm -rf /var/lib/apt/lists/*
COPY deploy/apache-docker.conf /etc/apache2/sites-available/000-default.conf
COPY deploy/php-production.ini /usr/local/etc/php/conf.d/store-production.ini
WORKDIR /var/www/html
COPY --from=vendor /app/vendor ./vendor
COPY . .
RUN mkdir -p data \
&& chown -R www-data:www-data data \
&& chmod +x bin/console docker-entrypoint-store.sh
EXPOSE 80
VOLUME ["/var/www/html/data"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD php -r '$c=@file_get_contents("http://127.0.0.1/healthz"); if ($c===false) exit(1);'
ENTRYPOINT ["/var/www/html/docker-entrypoint-store.sh"]
CMD ["apache2-foreground"]