-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.dockerfile
More file actions
48 lines (35 loc) · 1.06 KB
/
web.dockerfile
File metadata and controls
48 lines (35 loc) · 1.06 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
FROM node:23 AS node_builder
WORKDIR /app
COPY . .
RUN npm install \
&& npm run build
FROM php:8.4-apache as runtime
WORKDIR /var/www
RUN rm -rf /var/www/index.html
COPY . .
COPY apache2/http.conf /etc/apache2/sites-available/000-default.conf
COPY apache2/https.conf /etc/apache2/sites-available/default-ssl.conf
COPY --from=node_builder /app/public/build ./public/build
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN apt-get update && apt-get install -y \
curl \
git \
unzip \
libzip-dev \
libpq-dev \
postgresql-client \
certbot \
cron \
&& rm -rf /var/lib/apt/lists/* \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& docker-php-ext-install pdo pdo_pgsql \
&& composer install --no-dev --optimize-autoloader \
&& chown -R www-data:www-data /var/www \
&& chmod -R 775 /var/www \
&& chmod +x /var/www/entrypoint.sh \
&& php artisan key:generate \
&& a2enmod rewrite ssl \
&& a2ensite default-ssl
ENTRYPOINT ["/var/www/entrypoint.sh"]
CMD ["apache2-foreground"]