api-platform / demo

Demo app for the API Platform framework
https://demo.api-platform.com
MIT License
301 stars 202 forks source link

Docker build is broken #227

Closed maciej-laskowski closed 3 years ago

maciej-laskowski commented 3 years ago

Description
Running:

$ git clone https://github.com/api-platform/demo.git
$ cd demo
$ docker-compose up -d

Produces an error in php container

Verifying lock file contents can be installed on current platform.
Package operations: 143 installs, 0 updates, 0 removals
  - Downloading hautelook/alice-bundle (2.9.0)
    Failed to download hautelook/alice-bundle from dist: The "https://api.github.com/repos/hautelook/AliceBundle/zipball/17c5199b2a6efbc1383b0afe1cddfa3c176b7b6f" file could not be downloaded (HTTP/2 404 )
    Now trying to download from source
  - Syncing hautelook/alice-bundle (2.9.0) into cache

  [RuntimeException]                                                                                          

  Failed to clone https://github.com/hautelook/AliceBundle.git via https, ssh protocols, aborting.          

https://github.com/hautelook/AliceBundle.git leads to 404

Chris53897 commented 3 years ago

The main problem is discussed here https://github.com/nelmio/alice/issues/1089#issuecomment-916664460

The fix should be easy.

  1. Add the code to composer.json
"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/theofidry/AliceBundle"
        }
    ],
  1. Run composer install to update composer.lock

  2. Run docker-compose up -d

  3. Test container (Mac M1). Argh, not so easy :( The containers are build without error messages. But the php container is crushing. I am not sure if this is related or the error.

Executing script cache:clear [OK]
Executing script assets:install public [OK]

In Hub.php line 104:
                             
  Failed to send an update.  
                             

In TraceableResponse.php line 212:
                                                                              
  HTTP/1.1 401 Unauthorized returned for "http://caddy/.well-known/mercure".  
                                                                              

hautelook:fixtures:load [-b|--bundle [BUNDLE]] [--no-bundles [NO-BUNDLES]] [-m|--manager MANAGER] [--append] [--shard SHARD] [--purge-with-truncate]
maciej-laskowski commented 3 years ago

@Chris53897 thanks for having a look. There could be more things broken. Actually I was trying to set up a fresh copy of demo app because I believe the service decorators in services.yaml are broken (at least the are in out app after updating symfony/dependency-injection from 5.3.4 to 5.3.7) and I wanted to verify that on the demo app.

I did run demo app multiple times in the past without any problems.

Chris53897 commented 3 years ago

PHP-Container is running after i deactivated mecure in config-File mercure: false. But i do not get access to https://localhost/ (no entry in the caddy log)

Chris53897 commented 3 years ago

The problem with the decorator in 5.3.7 is another issue not related to APIP. https://github.com/symfony/symfony/issues/42880 Just add this to the "conflict" section of composer "symfony/dependency-injection": "5.3.7"

I did run demo app multiple times in the past without any problems.

Good news. Can you check if the PR works?

Chris53897 commented 3 years ago

I found the error why my setup is not working. https://github.com/api-platform/api-platform/issues/1986

maciej-laskowski commented 3 years ago

@Chris53897 Your fix works, thank you!