-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (22 loc) · 875 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Read how to launch here: docs/docker.md
FROM php:8.1-apache
MAINTAINER Joël Gaujard <j.gaujard@gmail.com>
# Install zip
RUN apt-get update && apt-get install -y zip vim
# Install xDebug
RUN pecl install xdebug && docker-php-ext-enable xdebug
ENV XDEBUG_MODE coverage
# Change Apache document root
ENV APACHE_DOCUMENT_ROOT /application/example
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Access to source code
COPY . /application
WORKDIR /application
# Install composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN mkdir /var/composer
ENV COMPOSER_HOME /var/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN /usr/bin/composer install --prefer-dist
EXPOSE 80