Browse Source

add initial Dockerfile

master
lub 1 year ago
parent
commit
87235b0083
  1. 21
      Dockerfile
  2. 2
      docker/ports.conf
  3. 8
      docker/site.conf

21
Dockerfile

@ -0,0 +1,21 @@
FROM docker.io/composer:latest AS composer
COPY composer.json composer.lock ./
RUN composer install
FROM docker.io/php:apache
# copy apache configs
RUN rm /etc/apache2/sites-enabled/* \
&& a2enmod rewrite
COPY docker/ports.conf /etc/apache2/ports.conf
COPY docker/site.conf /etc/apache2/sites-enabled/site.conf
# copy source files
COPY --from=composer /app/vendor ./vendor
COPY src ./src
USER nobody:nogroup

2
docker/ports.conf

@ -0,0 +1,2 @@
# if you change the port here, also change it in site.conf
Listen 9367

8
docker/site.conf

@ -0,0 +1,8 @@
# if you change the port here, also change it in ports.conf
<VirtualHost *:9367>
DocumentRoot /var/www/html/
# add a rewrite for /metrics
RewriteEngine On
RewriteRule "^/metrics$" "/var/www/html/src/metrics.php"
</VirtualHost>
Loading…
Cancel
Save