-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (44 loc) · 1.43 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
FROM composer:latest as composer_stage
WORKDIR /app
COPY composer.lock /app
COPY composer.json /app
RUN composer install --ignore-platform-reqs --prefer-dist --no-scripts --no-progress --no-interaction --no-dev
FROM php:8.2-fpm-bullseye
WORKDIR /app
COPY --from=composer_stage /app /app
# libpq-dev - Required for pdo_pgsql extenstion
# imagemagick - Required for generated files
# libmagickwand-dev - ImageMagick for generated files
RUN apt-get update
RUN apt-get install -y -q --no-install-recommends \
libpq-dev \
libmagickwand-dev
# https://stackoverflow.com/questions/70695447/docker-php8-1-1-fpm-how-to-install-imagick-php-extension
RUN pecl install imagick
# pdo pdo_pgsql - PostgreSQL driver
# bcmath - Required for php-amqplib/php-amqplib library
# sockets - Required for php-amqplib/php-amqplib library
# opcache - Opcache and JIT for performance incrase
RUN docker-php-ext-install \
pdo \
pdo_pgsql \
bcmath \
sockets \
opcache
# imagick - ImageMagick extension for generated files
RUN docker-php-ext-enable imagick
# Copy php config
COPY _docker/php/prod/base.ini /usr/local/etc/php/conf.d/base.ini
# Copy src folder
COPY src /app/src
# Copy entrypoints
COPY amqp_consumer.php /app
COPY cli.php /app
COPY index.php /app
RUN mkdir -p /app/uploads
RUN mkdir -p /app/generated
VOLUME /app/uploads
VOLUME /app/generated
ARG wwwdatauid=1000
RUN usermod -u $wwwdatauid www-data
RUN chown -R www-data:www-data /app