Dockerfile 1.26 KB
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1
FROM php:8.0-fpm-alpine
2
3
4

ENV PROJECT_DIR /var/www

Jacob Priddy's avatar
Jacob Priddy committed
5
6
7
# Make php-cs-fixer work with PHP 8 as it is not fully supported yet
ENV PHP_CS_FIXER_IGNORE_ENV 1

8
9
10
11
12
13
# Set working directory
WORKDIR ${PROJECT_DIR}

# Install dependencies
RUN apk update && apk add --no-cache \
    alpine-sdk \
14
    postgresql-dev \
15
16
17
18
19
20
    zlib-dev \
    libpng-dev \
    shadow \
    bash \
    bash-completion \
    vim \
Jacob Priddy's avatar
Jacob Priddy committed
21
    curl \
22
    coreutils \
Jacob Priddy's avatar
Jacob Priddy committed
23
    npm \
Jacob Priddy's avatar
Jacob Priddy committed
24
25
26
27
    && apk add --no-cache $PHPIZE_DEPS
#    && npm install -g @vue/cli \
#    && pecl install xdebug \
#    && docker-php-ext-enable xdebug
28
29
30

# Install PHP Extensions
RUN docker-php-ext-install pdo \
31
    pdo_pgsql \
32
33
34
35
36
37
38
39
40
41
42
43
    bcmath \
    fileinfo \
    gd

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Add user for application and create source directories
RUN groupadd -g 1000 www && \
    useradd -u 1000 -ms /bin/bash -g www www

# Copy existing application directory permissions
44
COPY --chown=www:www src/ ${WORKDIR}
45
COPY --chown=www:www simplesamlphp-1.19.0-rc1/ ${WORKDIR}../simplesamlphp
46
COPY --chown=www:www simple-saml/ ${WORKDIR}../simplesamlphp
47
48
49
50
51
COPY php/dev.ini /usr/local/etc/php/conf.d/local.ini

# Change current user to www
USER www

Jacob Priddy's avatar
Jacob Priddy committed
52
# Start php-fpm server
53
CMD ["php-fpm"]