-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (41 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
53 lines (41 loc) · 1.58 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM php:8.4-apache
ARG COMPOSER_FLAGS=--no-dev
RUN apt-get update && apt-get install -y \
curl \
git \
unzip \
zip \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
default-mysql-client \
ca-certificates \
gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip \
&& a2enmod rewrite \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
COPY package*.json ./
RUN npm install
COPY composer.json composer.lock ./
RUN composer install ${COMPOSER_FLAGS} --optimize-autoloader --no-interaction --no-scripts
COPY . .
RUN git config --global --add safe.directory /var/www/html \
&& npm run build \
&& composer dump-autoload --optimize \
&& mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views bootstrap/cache \
&& chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
COPY docker/entrypoint.sh /usr/local/bin/docker-entrypoint-app
RUN chmod +x /usr/local/bin/docker-entrypoint-app
ENTRYPOINT ["docker-entrypoint-app"]
CMD ["apache2-foreground"]