forked from kcal-app/kcal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (57 loc) · 1.37 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
64
65
66
67
68
69
ARG MEDIA_LIBRARY_DEPS="jpegoptim optipng pngquant gifsicle"
FROM php:8.2-fpm-alpine
ARG MEDIA_LIBRARY_DEPS
RUN apk add --no-cache --virtual \
.build-deps \
${PHPIZE_DEPS} \
${MEDIA_LIBRARY_DEPS} \
bash \
freetype-dev \
git \
icu-dev \
icu-libs \
libjpeg-turbo-dev \
libpng-dev \
libzip-dev \
mysql-client \
oniguruma-dev \
openssh-client \
openssl \
pcre-dev \
postgresql-dev \
rsync \
zlib-dev
# Configure php extensions.
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
# Install php extensions.
RUN docker-php-ext-install \
bcmath \
calendar \
exif \
gd \
intl \
pdo_mysql \
pdo_pgsql \
pcntl \
zip
# Install PECL extensions.
RUN pecl install redis
RUN docker-php-ext-enable redis
# Install composer.
ENV COMPOSER_HOME /composer
ENV PATH ./vendor/bin:/composer/vendor/bin:$PATH
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer
# Add user and group.
RUN addgroup -S -g 1000 www
RUN adduser -S -u 1000 -s /bin/bash -G www www
# Setup working directory.
WORKDIR /app
COPY --chown=www:www . /app
# Install dependencies.
RUN composer install --optimize-autoloader --no-dev
# Change current user to www.
USER www
# Expose port 9000 and start php-fpm server.
EXPOSE 9000
CMD ["php-fpm"]