-
Notifications
You must be signed in to change notification settings - Fork 48
/
Dockerfile
27 lines (22 loc) · 1.03 KB
/
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
FROM node:23-alpine as NodeBuildContainer
COPY . /usr/src/trwl
WORKDIR /usr/src/trwl
RUN npm install && npm run build && rm -rf node_modules
FROM composer:2 as ComposerBuildContainer
COPY --from=NodeBuildContainer /usr/src/trwl /usr/src/trwl
WORKDIR /usr/src/trwl
RUN composer install --ignore-platform-reqs --no-interaction --no-progress --no-suggest --optimize-autoloader
RUN php artisan optimize
FROM php:8.4.1-apache
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN apt update && \
apt upgrade -y && \
apt install -y zlib1g-dev libpng-dev wait-for-it && \
docker-php-ext-install gd exif pdo pdo_mysql && \
a2enmod rewrite && \
a2enmod http2 && \
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=ComposerBuildContainer --chown=www-data:www-data /usr/src/trwl /var/www/html
ENTRYPOINT ["/var/www/html/docker-entrypoint.sh"]
CMD ["apache2-foreground"]