-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (29 loc) · 992 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
30
31
32
33
34
35
36
37
38
39
40
# images
FROM php:8.1-apache
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# pindahkan kode project ke direktori kerja Apache
COPY . /var/www/html
# atur directory kerja di the container
WORKDIR /var/www/html
# install dependencies
RUN docker-php-ext-install mysqli
RUN apt-get update && apt-get install -y \
libicu-dev \
libzip-dev \
&& docker-php-ext-install \
intl \
zip
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install dependencies
RUN composer install
# konfigurasi Apache
RUN a2enmod rewrite
# Mengubah kepemilikan file
RUN chown -R www-data:www-data /var/www/html/
#expose
EXPOSE 80
# Define the entry point for the container
CMD ["apache2-foreground"]