0

I am trying to install the Opensoft/json-streaming parser from their github repository. I am doing all of this through a Dockerfile. For some reason, the opensoft package is not being added to the "vendor" directory after this runs.

Dockerfile:

FROM composer:2 AS dependencies

COPY composer.json composer.json
COPY composer.lock composer.lock
RUN mkdir app
COPY ./app/AppKernel.php ./app
COPY ./app/AppCache.php ./app

RUN composer install \
    --ignore-platform-reqs \
    --no-interaction \
    --no-plugins \
    --no-scripts \
    --prefer-dist

FROM php:7.2-apache

WORKDIR /var/www

# Enable Apache modules
RUN a2enmod rewrite

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    libxml2-dev \
    curl \
    cgi-mapserver \
    gdal-bin \
    mapserver-bin \
    libdate-manip-perl \
    #clean up after installs
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install PHP Extensions
RUN docker-php-ext-install pdo_mysql xml && docker-php-ext-enable pdo_mysql xml
RUN pecl install redis && docker-php-ext-enable redis

# Create needed directories
RUN mkdir -p /var/www/cache /var/www/data

# Copy apache virtual host config and startup script
COPY /build/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
COPY /build/start-apache /usr/local/bin
RUN chmod 755 /usr/local/bin/start-apache

# Copy source files to the web root folder
COPY ./app /var/www/app
COPY ./bin /var/www/bin
COPY ./src /var/www/src
COPY ./var /var/www/var
COPY ./web /var/www/web

COPY --from=dependencies /app/vendor /var/www/vendor

RUN chown -R www-data.www-data /var/www

EXPOSE 8080

ENTRYPOINT ["start-apache"]

Composer.json:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/"  },
        "classmap": [
          "app/AppKernel.php",
          "app/AppCache.php"
        ]
    },
    "repositories": [{
        "type": "git",
        "url": "https://github.com/opensoft/json-streaming-parser.git"
    }],
    "require": {
        "php": ">=7.2.1",
        "symfony/symfony": "^4.4",
        "doctrine/orm": "^2.6",
        "doctrine/doctrine-bundle": "^2.0",
        "symfony/swiftmailer-bundle": "^3.4.0",
        "symfony/monolog-bundle": "^3.5",
        "sensio/framework-extra-bundle": "^5.5",
        "incenteev/composer-parameter-handler": "~2.0",
        "psr/http-message": "^1.0",
        "salsify/json-streaming-parser": "^7.0",
        "phpoffice/phpspreadsheet": "^1.5",
        "phpseclib/phpseclib": "^2.0",
        "wapmorgan/unified-archive": "^0.1.2",
        "psr/simple-cache": "^1.0",
        "opensoft/json-streaming-parser": "^1.3"
    },
    "require-dev": {
        "phpunit/phpunit": "^5.7"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-var-dir": "var",
        "symfony-bin-dir": "bin",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}

I have tried changing around the composer.json to look like this, however this did not work:

"repositories": [
    {
        "type":"package",
        "package": {
          "name": "opensoft/json-streaming-parser",
          "version":"master",
          "source": {
              "url": "https://github.com/opensoft/json-streaming-parser.git",
              "type": "git",
              "reference":"master"
            }
        }
    }
],
"require": {
    "opensoft/json-streaming-parser": "master"
}
sd-gallowaystorm
  • 129
  • 4
  • 15

0 Answers0