-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (50 loc) · 1.53 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
50
51
52
53
54
55
56
57
58
FROM php:7.3-apache
#Установили дев пакеты и очистили apt кеш.
RUN apt-get update && apt-get install -y \
curl \
g++ \
git \
libbz2-dev \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libmcrypt-dev \
libpng-dev \
libreadline-dev \
sudo \
unzip \
zip \
zlib1g-dev \
libzip-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# 2. Конфигурируем апач .
RUN echo "ServerName laravel-app.local" >> /etc/apache2/apache2.conf
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/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN a2enmod rewrite headers
# 3. Расширения для php.
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
RUN docker-php-ext-install \
bcmath \
bz2 \
calendar \
iconv \
intl \
mbstring \
opcache \
pdo_mysql \
pdo \
pdo_pgsql \
zip
# 4. Установка composer.
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# 5. Установка nodejs
RUN rm -rf /var/lib/apt/lists/ && curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install nodejs -y
# 6. Настройка прав для пользователя
ARG uid
RUN useradd -G www-data,root -u $uid -d /home/devuser devuser
RUN mkdir -p /home/devuser/.composer && \
chown -R devuser:devuser /home/devuser