A
A
artshelom2020-06-12 14:35:48
Docker
artshelom, 2020-06-12 14:35:48

How to send a request to docker from a computer?

It turns out to make a request in the docker via curl, but when I do it through the browser, there is no answer.
Here is docker compuse:

version: '3.4'

networks:
  dockerapi-dev:
    driver: bridge 

services:
  dockerapi:
    image: dockerapi:latest
    depends_on:
      - "postgres_image"
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8000:80"     
    environment:
      DB_CONNECTION_STRING: "host=postgres_image;port=5432;database=blogdb;username=bloguser;password=bloguser"
    networks:
      - dockerapi-dev  
  
  postgres_image:
    image: postgres:latest
    ports:
      - "5432"
    restart: always
    volumes:
      - db_volume:/var/lib/postgresql/data
      - ./dbscripts/seed.sql :/docker-entrypoint-initdb.d/seed.sql
    environment:
      POSTGRES_USER: "bloguser"
      POSTGRES_PASSWORD: "bloguser"
      POSTGRES_DB: "blogdb"
    networks:
      - dockerapi-dev
volumes:
  db_volume:


Can't figure out how to do dcoker-compuse but can't figure out what's wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question