A
A
Artem2020-06-28 16:26:47
PHP
Artem, 2020-06-28 16:26:47

Where can I get an API domain for testing in docker?

Hello.

I can't figure out what url I need to put in api.suite.yml to test the API.
In every case that came to my mind, I received

cURL error 7: Failed to connect to php port 8000: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)


api.suite.yml

actor: ApiTester
modules:
  enabled:
    - REST:
        url: http://php:8000
        depends: PhpBrowser
    - Yii2:
        configFile: 'config/test-local.php'
        part:
          - email
          - ORM
          - Fixtures
          - init
        cleanup: true
        transaction: false
        recreateApplication: true
        entryScript: index-test.php



docker-compose.yml

version: '2'
services:
  php:
    image: yiisoftware/yii2-php:7.4-apache
    volumes:
      - ~/.composer-docker/cache:/root/.composer/cache:delegated
      - ./:/app:delegated
    ports:
      - '8000:80'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2020-06-28
@proudmore

Try
http://php:80

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question