-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (36 loc) · 1.11 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM php:7.4-apache
# Copy virtual host into container
COPY ./docker/000-default.conf /etc/apache2/sites-available/000-default.conf
# Enable rewrite mode
RUN a2enmod rewrite
# Install necessary packages
RUN apt-get update && \
apt-get install \
libzip-dev \
wget \
git \
unzip \
-y --no-install-recommends
# Install PHP Extensions
RUN docker-php-ext-install zip pdo_mysql
# Copy php.ini
COPY ./docker/php.ini /usr/local/etc/php/
# Create a non-root user for running Composer
RUN useradd -ms /bin/bash composer
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install Node.js
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# Copy application files
COPY . /var/www
# Change the owner of the container document root
RUN chown -R www-data:www-data /var/www
# Change the current working directory
WORKDIR /var/www
# Install application dependencies
RUN composer install --optimize-autoloader --no-dev
RUN npm install
RUN npm run dev
# Start Apache in foreground
CMD ["apache2-foreground"]