-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
41 lines (35 loc) · 1 KB
/
dockerfile
File metadata and controls
41 lines (35 loc) · 1 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
FROM php:8.2-apache
# Set working directory
WORKDIR /var/www/html
# Install essential dependencies and PHP extensions only
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
nodejs \
npm \
&& docker-php-ext-install \
pdo_mysql \
mbstring \
zip \
gd \
&& a2enmod rewrite \
&& sed -i 's/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/html\/public/g' /etc/apache2/sites-available/000-default.conf \
&& sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy application and install dependencies
COPY . .
RUN composer install --no-interaction --no-dev --optimize-autoloader \
&& npm install \
&& npm run build
# Simplified startup script
EXPOSE 80
CMD ["apache2-foreground"]