Skip to content
Snippets Groups Projects
Dockerfile 911 B
Newer Older
FROM php:8.1-fpm-alpine

COPY docker/wait-for-it.sh /usr/local/bin/wait-for-it
RUN chmod +x /usr/local/bin/wait-for-it && apk add --no-cache bash

ENV APP_ENV=dev

WORKDIR /var/www/html

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions \
    apcu \
    intl \
    opcache \
    openssl \
    pdo_pgsql \
    xdebug \
    zip

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apk add --no-cache nginx
COPY docker/nginx.conf docker/calendar.conf /etc/nginx/

# COPY --chown=root:root . .
# RUN composer install --prefer-dist --no-dev --optimize-autoloader

CMD composer install && wait-for-it database:5432 -- bin/console doctrine:migrations:migrate -n && nginx && php-fpm