diff --git a/docker-compose.yml b/docker-compose.yml index dddc44d..4145aa7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,18 +4,14 @@ services: php: build: context: . - dockerfile: Dockerfile + dockerfile: docker/php/Dockerfile target: dev container_name: goteo-v4-php volumes: - .:/app - ./docker/php/conf.d/apc.ini:/usr/local/etc/php/conf.d/apc.ini:ro - ./docker/php/conf.d/opcache.ini:/usr/local/etc/php/conf.d/opcache.ini:ro - environment: - XDEBUG_MODE: debug - XDEBUG_CONFIG: "client_host=host.docker.internal" - APP_ENV: development - APP_DEBUG: true + env_file: ".env.local" ports: - "9000:9000" - "9003:9003" diff --git a/Dockerfile b/docker/php/Dockerfile similarity index 72% rename from Dockerfile rename to docker/php/Dockerfile index f0ac172..decc4a9 100644 --- a/Dockerfile +++ b/docker/php/Dockerfile @@ -10,27 +10,29 @@ RUN apk --no-cache add \ unzip RUN docker-php-ext-install \ - opcache \ pdo \ - pdo_mysql \ + pdo_mysql + +RUN docker-php-ext-install \ intl \ zip -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:lts /usr/bin/composer /usr/local/bin/composer -WORKDIR /app FROM base AS dev -RUN apk --no-cache add $PHPIZE_DEPS \ - && pecl install xdebug \ +RUN docker-php-ext-install opcache + +RUN apk --no-cache add $PHPIZE_DEPS +RUN pecl install xdebug \ && docker-php-ext-enable xdebug COPY . /app - RUN chown -R www-data:www-data /app USER www-data +WORKDIR /app RUN composer install --prefer-dist --no-scripts @@ -40,6 +42,7 @@ COPY . /app RUN chown -R www-data:www-data /app USER www-data +WORKDIR /app RUN composer install --prefer-dist --no-scripts --no-dev --optimize-autoloader