-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
46 lines (35 loc) · 1.14 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
# PHP-FPM is a FastCGI implementation for PHP.
# Read more here: https://hub.docker.com/_/php
FROM php:8.1-fpm
# Install system dependencies
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
unzip \
libzip-dev
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql gd zip \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis
# Install NPM
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Composer
COPY --from=composer:2.3 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy existing application directory contents
COPY ./src /var/www/html
# Copy existing application directory permissions
COPY --chown=www:www ./src /var/www/html
# Change current user to www
USER www
# Set port for application
EXPOSE 8000