forked from longhornopen/qualtrics-lti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (22 loc) · 886 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
FROM composer:2 as phpbuild
ADD web /var/www/html
WORKDIR /var/www/html
RUN composer install --ignore-platform-reqs --no-dev
FROM node:20 as npmbuild
COPY --from=phpbuild /var/www/html /var/www/html
WORKDIR /var/www/html
RUN npm ci && npm run production && rm -rf /var/www/html/node_modules
FROM php:8.2-apache
# enable rewrite for Laravel pretty URLs
RUN a2enmod rewrite
# change apache webroot from / to /public/
RUN sed -i s/"DocumentRoot \/var\/www\/html"/"DocumentRoot \/var\/www\/html\/public"/ /etc/apache2/sites-available/000-default.conf
RUN apt-get update \
&& apt-get install -y \
libxml2-dev \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install xml opcache pdo_mysql
COPY --from=npmbuild /var/www/html /var/www/html
RUN chmod +w -R /var/www/html/bootstrap/cache
RUN chmod +w -R /var/www/html/storage
RUN chown -R www-data:www-data /var/www/html