-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
60 lines (48 loc) · 1.48 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
59
60
# main image
FROM php:8.3-apache
# installing dependencies
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
libfreetype6-dev \
libicu-dev \
libgmp-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
unzip \
zlib1g-dev
# configuring php extension
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
RUN docker-php-ext-configure intl
# installing php extension
RUN docker-php-ext-install bcmath calendar exif gd gmp intl mysqli pdo pdo_mysql zip
# installing composer
COPY --from=composer:2.7 /usr/bin/composer /usr/local/bin/composer
# installing node js
COPY --from=node:22.9 /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node:22.9 /usr/local/bin/node /usr/local/bin/node
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
# installing global node dependencies
RUN npm install -g npx
RUN npm install -g laravel-echo-server
# arguments
ARG container_project_path
ARG uid
ARG user
# setting work directory
WORKDIR $container_project_path
# adding user
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# setting apache
COPY ./.configs/apache.conf /etc/apache2/sites-available/000-default.conf
RUN a2enmod rewrite
# setting up project from `src` folder
RUN chmod -R 775 $container_project_path
RUN chown -R $user:www-data $container_project_path
# changing user
USER $user