Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue installing iRail with Docker #511

Open
VandeVoordeMatthias opened this issue Feb 28, 2024 · 13 comments
Open

Issue installing iRail with Docker #511

VandeVoordeMatthias opened this issue Feb 28, 2024 · 13 comments

Comments

@VandeVoordeMatthias
Copy link

Hello, I would like to contribute to iRail and run it with docker. But when i follow the steps, i get an error because the PHP is outdated and some packages are abandoned. I know this is not normally the place for this but the gitter room is kinda dead.

The errors:

Package ptachoire/tac is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
36 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> cd vendor/irail/stations; npm install ; node bin/build.js > stations.jsonld
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated xmldom@0.1.19: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated uuid@3.3.3: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142

added 58 packages, and audited 59 packages in 5s

1 package is looking for funding
  run `npm fund` for details

10 vulnerabilities (1 low, 4 moderate, 2 high, 3 critical)`
@Bertware
Copy link
Member

Bertware commented Feb 28, 2024

Hi Matthias,

These are some composer warnings regarding outdated packages, as well as some npm warnings regarding javascript packages (javascript is only used during installation by irail/stations in order to generate a json file). They do not affect the working of the application. If you're having issues running the docker container, it might be because of another error not described in the log excerpt you shared.

I'm currently refactoring the codebase into a strongly typed more object-oriented version in order to add new features and v2 endpoints, which also should be easier to understand compared to the current master version. A bit more about that can be found in #503. I'll create some new issues which are easier to follow when it is stable enought for everyone to test backwards compatibility and move over, I'm currently testing the backwards compatibility myself. You can find this version in the lumen branch: https://github.com/iRail/iRail/tree/feature/laravel-lumen-framework . I'm actively using the docker-compose setup in there, so that one's guaranteed to work.

@VandeVoordeMatthias
Copy link
Author

Thank you for your response. I successfully installed the docker container with your repo. However when doing a request I get an error about the API key.

The request:
http://localhost:8080/v1/liveboard/?station=Gent-sint-pieters&lang=nl&format=json

The response:
{"code":504,"message":"The remote server returned an error: ERROR reason : error : 7501 : _API-Key : Incorrect credential received"}

@VandeVoordeMatthias
Copy link
Author

When doing a request to a vehicle, I get a bunch of errors.

Request:

http://localhost:8080/v1/vehicle?id=559&format=json

Response:

{
    "code": 0,
    "message": "Irail\\Repositories\\Riv\\NmbsRivRawDataRepository::getJourneyDetailRef(): Return value must be of type ?string, Irail\\Models\\CachedData returned",
    "previous": null,
    "at": "",
    "stack": [
        "#0 \/var\/www\/app\/Repositories\/Riv\/NmbsRivRawDataRepository.php(140): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getJourneyDetailRef(Object(Irail\\Repositories\\Gtfs\\GtfsTripStartEndExtractor), Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request), Object(Irail\\Repositories\\Gtfs\\Models\\JourneyWithOriginAndDestination))",
        "#1 \/var\/www\/app\/Repositories\/Riv\/NmbsRivRawDataRepository.php(124): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getFreshVehicleJourneyData(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
        "#2 \/var\/www\/app\/Traits\/Cache.php(157): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->Irail\\Repositories\\Riv\\{closure}()",
        "#3 \/var\/www\/app\/Repositories\/Riv\/NmbsRivRawDataRepository.php(123): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getCacheOrUpdate('|VehicleJourney...', Object(Closure))",
        "#4 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivVehicleJourneyRepository.php(61): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getVehicleJourneyData(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
        "#5 \/var\/www\/app\/Http\/Controllers\/DatedVehicleJourneyV1Controller.php(26): Irail\\Repositories\\Nmbs\\NmbsRivVehicleJourneyRepository->getDatedVehicleJourney(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
        "#6 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(36): Irail\\Http\\Controllers\\DatedVehicleJourneyV1Controller->getVehicleById(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
        "#7 \/var\/www\/vendor\/illuminate\/container\/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()",
        "#8 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))",
        "#9 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Laravel\\Lumen\\Application), Array, Object(Closure))",
        "#10 \/var\/www\/vendor\/illuminate\/container\/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Laravel\\Lumen\\Application), Array, Array, NULL)",
        "#11 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(391): Illuminate\\Container\\Container->call(Array, Array)",
        "#12 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(356): Laravel\\Lumen\\Application->callControllerCallable(Array, Array)",
        "#13 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(331): Laravel\\Lumen\\Application->callLumenController(Object(Irail\\Http\\Controllers\\DatedVehicleJourneyV1Controller), 'getVehicleById', Array)",
        "#14 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(284): Laravel\\Lumen\\Application->callControllerAction(Array)",
        "#15 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(269): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)",
        "#16 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(171): Laravel\\Lumen\\Application->handleFoundRoute(Array)",
        "#17 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(48): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#18 \/var\/www\/vendor\/illuminate\/http\/Middleware\/TrustProxies.php(39): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#19 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
        "#20 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#21 \/var\/www\/app\/Http\/Middleware\/RequestDumpingMiddleware.php(26): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#22 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Irail\\Http\\Middleware\\RequestDumpingMiddleware->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
        "#23 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#24 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(119): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#25 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(428): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
        "#26 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(167): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))",
        "#27 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(112): Laravel\\Lumen\\Application->dispatch(NULL)",
        "#28 \/var\/www\/public\/index.php(28): Laravel\\Lumen\\Application->run()",
        "#29 {main}"
    ]
}

Bertware added a commit that referenced this issue Feb 29, 2024
@Bertware
Copy link
Member

Thanks for pointing this out! There was a line of code missing on that code path, used to get the value which was being cached from the CachedData wrapper object.

@VandeVoordeMatthias
Copy link
Author

Thanks for helping! I've got an new error...
Request:
http://localhost:8080/v1/vehicle?id=559&format=json

Response:

{"code":504,"message":"iRail could not read the data received from the remote server."}

@Bertware
Copy link
Member

That's a general error, signaling that some underlying data source didn't return a response as expected. The logs could clarify that error further, but it's typically not something that can be fixed.

@VandeVoordeMatthias
Copy link
Author

Here are the logs if it would be any useful.

http://localhost:8080/v1/vehicle?id=559&format=json

[2024-02-29 19:27:34] local.DEBUG: GET https://mobile-riv.api.belgianrail.be/riv/v1.0/journey?trainFilter=L559&originExtId=8891553&destExtId=8822004&date=2024-02-29&lang=en?trainFilter=L559&originExtId=8891553&destExtId=8822004&date=2024-02-29&lang=en  
[2024-02-29 19:27:34] local.DEBUG: Received response with HTTP code 403 for URL https://mobile-riv.api.belgianrail.be/riv/v1.0/journey?trainFilter=L559&originExtId=8891553&destExtId=8822004&date=2024-02-29&lang=en?trainFilter=L559&originExtId=8891553&destExtId=8822004&date=2024-02-29&lang=en in 0 secconds  

.
.
http://localhost:8080/v1/liveboard/?station=Gent-sint-pieters&lang=nl&format=json

[2024-02-29 19:55:16] local.DEBUG: GET https://mobile-riv.api.belgianrail.be/api/v1.0/dacs?query=DeparturesApp&UicCode=8892007&FromDate=2024-02-29+20%3A55%3A00&Count=100  
[2024-02-29 19:55:16] local.DEBUG: Received response with HTTP code 403 for URL https://mobile-riv.api.belgianrail.be/api/v1.0/dacs?query=DeparturesApp&UicCode=8892007&FromDate=2024-02-29+20%3A55%3A00&Count=100 in 0 secconds  
[2024-02-29 19:55:16] local.DEBUG: ERROR reason : error : 7501 : _API-Key : Incorrect credential received  

@Bertware
Copy link
Member

The NMBS_RIV_API_KEY environment variable is not set, see the example environment file to see which variables are required.

@VandeVoordeMatthias
Copy link
Author

Hi, i've set the .env file like this:

APP_NAME=Lumen
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=Europe/Brussels

LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=

# Which requests, made by iRail, to log. Requests are logged into the application logs. ALL | ERROR | NONE
LOG_REQUESTS=ALL
# Set LOG_REQUESTS_FILE to TRUE in order to log requests to files in the app directory
# LOG_REQUESTS_FILE=TRUE

DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=irail
DB_USERNAME=irail-api
DB_PASSWORD=irail-api

CACHE_DRIVER=apc
QUEUE_CONNECTION=sync

NMBS_RIV_API_KEY=IOS-v0001-20190214-YKNDlEPxDqynCovC2ciUOYl8L6aMwU4WuhKaNtxl
GTFS_RANGE_DAYS_BACKWARDS=3
GTFS_RANGE_DAYS_FORWARDS=14

But now i'm getting an error message saying it doesn't find any tables.

The request:
http://localhost:8080/v1/liveboard?station=gent-sint-pieters

The error:

{
    "code": "42S02",
    "message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'irail.occupancy_reports' doesn't exist (Connection: mysql, SQL: SELECT vehicle_id, occupancy FROM occupancy_reports WHERE source=NMBS AND stop_id=8892007 AND journey_start_date=2024-03-12 00:00:00)",
    "previous": {
        "errorInfo": [
            "42S02",
            1146,
            "Table 'irail.occupancy_reports' doesn't exist"
        ]
    },
    "at": "",
    "stack": [
        "#0 \/var\/www\/vendor\/illuminate\/database\/Connection.php(783): Illuminate\\Database\\Connection->runQueryCallback('SELECT vehicle_...', Array, Object(Closure))",
        "#1 \/var\/www\/vendor\/illuminate\/database\/Connection.php(414): Illuminate\\Database\\Connection->run('SELECT vehicle_...', Array, Object(Closure))",
        "#2 \/var\/www\/vendor\/illuminate\/database\/DatabaseManager.php(509): Illuminate\\Database\\Connection->select('SELECT vehicle_...', Array)",
        "#3 \/var\/www\/vendor\/illuminate\/support\/Facades\/Facade.php(355): Illuminate\\Database\\DatabaseManager->__call('select', Array)",
        "#4 \/var\/www\/app\/Database\/OccupancyDao.php(297): Illuminate\\Support\\Facades\\Facade::__callStatic('select', Array)",
        "#5 \/var\/www\/app\/Database\/OccupancyDao.php(233): Irail\\Database\\OccupancyDao->readLevelsForStation(Object(Irail\\Models\\Dao\\OccupancyReportSource), 8892007, Object(Carbon\\Carbon))",
        "#6 \/var\/www\/app\/Database\/OccupancyDao.php(194): Irail\\Database\\OccupancyDao->readLevels(Object(Irail\\Models\\Dao\\OccupancyReportSource), 'IC707', 8892007, Object(Carbon\\Carbon), Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
        "#7 \/var\/www\/app\/Database\/OccupancyDao.php(176): Irail\\Database\\OccupancyDao->getOfficialLevel('IC707', '008892007', Object(Carbon\\Carbon), Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
        "#8 \/var\/www\/app\/Database\/OccupancyDao.php(50): Irail\\Database\\OccupancyDao->getStoredNmbsOccupancy(Object(Irail\\Models\\DepartureOrArrival), Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
        "#9 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivLiveboardRepository.php(178): Irail\\Database\\OccupancyDao->getOccupancy(Object(Irail\\Models\\DepartureOrArrival), NULL, Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
        "#10 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivLiveboardRepository.php(94): Irail\\Repositories\\Nmbs\\NmbsRivLiveboardRepository->parseStopAtStation(Object(Irail\\Http\\Requests\\LiveboardV1Request), Object(Irail\\Models\\Station), Array)",
        "#11 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivLiveboardRepository.php(62): Irail\\Repositories\\Nmbs\\NmbsRivLiveboardRepository->parseNmbsRawData(Object(Irail\\Http\\Requests\\LiveboardV1Request), Object(Irail\\Models\\CachedData))",
        "#12 \/var\/www\/app\/Http\/Controllers\/LiveboardV1Controller.php(39): Irail\\Repositories\\Nmbs\\NmbsRivLiveboardRepository->getLiveboard(Object(Irail\\Http\\Requests\\LiveboardV1Request))",
        "#13 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(36): Irail\\Http\\Controllers\\LiveboardV1Controller->getLiveboardById(Object(Irail\\Http\\Requests\\LiveboardV1Request))",
        "#14 \/var\/www\/vendor\/illuminate\/container\/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()",
        "#15 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))",
        "#16 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Laravel\\Lumen\\Application), Array, Object(Closure))",
        "#17 \/var\/www\/vendor\/illuminate\/container\/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Laravel\\Lumen\\Application), Array, Array, NULL)",
        "#18 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(391): Illuminate\\Container\\Container->call(Array, Array)",
        "#19 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(356): Laravel\\Lumen\\Application->callControllerCallable(Array, Array)",
        "#20 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(331): Laravel\\Lumen\\Application->callLumenController(Object(Irail\\Http\\Controllers\\LiveboardV1Controller), 'getLiveboardByI...', Array)",
        "#21 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(284): Laravel\\Lumen\\Application->callControllerAction(Array)",
        "#22 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(269): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)",
        "#23 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(171): Laravel\\Lumen\\Application->handleFoundRoute(Array)",
        "#24 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(48): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#25 \/var\/www\/vendor\/illuminate\/http\/Middleware\/TrustProxies.php(39): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#26 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
        "#27 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#28 \/var\/www\/app\/Http\/Middleware\/RequestDumpingMiddleware.php(26): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#29 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Irail\\Http\\Middleware\\RequestDumpingMiddleware->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
        "#30 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#31 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(119): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
        "#32 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(428): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
        "#33 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(167): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))",
        "#34 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(112): Laravel\\Lumen\\Application->dispatch(NULL)",
        "#35 \/var\/www\/public\/index.php(28): Laravel\\Lumen\\Application->run()",
        "#36 {main}"
    ]
}

After some research, I found that i still need to migrate like this: php artisan migrate.
But with this I also get an error message when I try to run this.

In Connection.php line 829:
                                                                                                                                                                             
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed: nodename nor servname provided, or not known (Connection: mysql, SQL: select table_name as `n  
  ame`, (data_length + index_length) as `size`, table_comment as `comment`, engine as `engine`, table_collation as `collation` from information_schema.tables where table_s  
  chema = 'irail' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)                                                                                  
                                                                                                                                                                             

In Connector.php line 65:
                                                                                                                            
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed: nodename nor servname provided, or not known  
                                                                                                                            

In Connector.php line 65:
                                                                                                                         
  PDO::__construct(): php_network_getaddresses: getaddrinfo for db failed: nodename nor servname provided, or not known  
                    ```                                                                                                 

@centiveo
Copy link

Are you trying to run 'php artisan migrate' in the app container? This looks like a connection error where the app container can't connect properly to the db container.

@VandeVoordeMatthias
Copy link
Author

Yes, i'm doing that. I'm trying to resolve this issue. Docker list shows it correct:

CONTAINER ID   IMAGE             COMMAND                  CREATED      STATUS         PORTS                              NAMES
0a3896831469   nginx:latest      "/docker-entrypoint.…"   2 days ago   Up 8 minutes   0.0.0.0:8080->80/tcp               nginx
4ea418eab5c6   irail-v2          "docker-php-entrypoi…"   2 days ago   Up 8 minutes   9000/tcp, 0.0.0.0:8088->8080/tcp   app
dcd9f7ab0d19   mariadb:10.4.12   "docker-entrypoint.s…"   2 days ago   Up 8 minutes   0.0.0.0:33060->3306/tcp            db

Bertware added a commit that referenced this issue Mar 13, 2024
Bertware added a commit that referenced this issue Mar 13, 2024
@Bertware
Copy link
Member

Bertware commented Mar 13, 2024

Sounds like an issue with the database hostname configuration, but the database configuration from the docker file should work out of the box, Docker environment variables should take precedence over env files, so the application should use those correct credentials.

      DB_HOST: db
      DB_PORT: 3306

This seems to be correct based on the logs: getaddrinfo for db failed, where db is the hostname. What operating system are you using?

@VandeVoordeMatthias
Copy link
Author

I'm using macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants