-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (49 loc) · 1.32 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
61
62
63
FROM php:8.1.0-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Copy composer.lock and composer.json
COPY composer.lock composer.json /var/www/html/
# Set working directory
WORKDIR /var/www/html/
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
curl \
libzip-dev \
libpng-dev \
libxpm-dev \
libonig-dev \
libxml2-dev \
libwebp-dev \
libjpeg62-turbo-dev \
libfreetype6-dev\
jpegoptim optipng pngquant gifsicle \
locales \
nano \
vim \
zip \
unzip
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-configure gd \
--with-jpeg \
--with-freetype
RUN docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd
# Redis
RUN pecl install redis && docker-php-ext-enable redis
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Add user for laravel application
RUN groupadd -g $uid $user
RUN useradd -u $uid -ms /bin/bash -g $user $user
# Copy existing application directory contents to the working directory
COPY . /var/www/html
# Copy existing application directory permissions
COPY --chown=$user:$user . /var/www/html
USER $user
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]