Answer the question
In order to leave comments, you need to log in
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:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question