Answer the question
In order to leave comments, you need to log in
docker-compose how to link to real host?
Colleagues, good afternoon.
Perhaps the question will seem stupid.
I have recently been working with docker.
docker-compose.yml
version: "3.1"
services:
# Php application
app:
container_name: gorodbrand.app
restart: on-failure
build: .
volumes:
- .:/var/www
- ./docker/php/log:/var/log
depends_on:
- db
# Database
db:
image: percona
container_name: gorodbrand.db
restart: always
volumes:
#- ./docker/mysql/.db:/var/lib/mysql
- ./docker/mysql/log:/var/log/mysql
- ./docker/mysql/conf.d:/etc/mysql/conf.d
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=catalog
- MYSQL_USER=1234
- MYSQL_PASSWORD=1234
ports:
- "3340:3306"
# Nginx server api
nginx-api:
image: nginx:latest
container_name: gorodbrand.nginx-api
#restart: on-failure
build: ./docker/nginx
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/sites-enabled/vhost-api.gorodbrand.conf:/etc/nginx/sites-enabled/vhost-api.gorodbrand.conf
- ./docker/nginx/logs:/var/log/nginx
ports:
- "8080:80"
depends_on:
- app
Answer the question
In order to leave comments, you need to log in
ip:8080
you have container port 80 mapped to host port 8080 in nginx-api
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question