Docker with Laravel on windows 10: Laravel post request to create token issue "connection refused"

  access-token, docker, laravel, windows

I’m running Laravel on docker. The web app works fine and other post man requests work fine till I get to this line

const OAUTH_TOKEN = '/oauth/token';

return $this->post(self::OAUTH_TOKEN, $this->getBody());

Using Postman I get

"cURL error 7: Failed to connect to localhost port 8080: Connection refused

env

APP_URL=http://localhost:8080
UID=1000

docker file

version: '3.0'
services:
nginx:
  image: nginx:latest
  container_name: vp5_srv
ports:
  - "8080:80"
volumes:
  - ./:/code/
  - ./docker/nginx/site.conf:/etc/nginx/conf.d/default.conf
links:
  - php
networks:
  code-network:
    aliases:
      - vp5_srv
php:
  build:
    context: 'docker/php7'
    args:
      uid: ${UID}
   container_name: vp5_be
   volumes:
     - ./:/code/
     - ./docker/php7/xdebug.ini/:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
networks:
  code-network:
    aliases:
      - vp5_be
mysql:
image: mysql:8.0.20
container_name: vp5_db
restart: unless-stopped
tty: true
ports:
  - "3306:3306"
volumes:
  - ./docker/mysql:/docker-entrypoint-initdb.d
environment:
  MYSQL_ROOT_PASSWORD: password
  MYSQL_DATABASE: ${DB_DATABASE}
  MYSQL_USER: ${DB_USERNAME}
  MYSQL_PASSWORD: ${DB_PASSWORD}
  SERVICE_TAGS: dev
  SERVICE_NAME: mysql
networks:
  code-network:
    aliases:
      - vp5_db
networks:
  code-network:
  driver: bridge

How to allow windows not to block connection to or from docker to save the token?

Source: Windows Questions

LEAVE A COMMENT