I have a docker-compose.yml file that looks something like this
version: "3.0"
volumes:
dbdata:
.:
services:
api:
build:
context: ./api
args:
- APP_NAME=${APP_NAME}
dockerfile: dockerfile
depends_on:
- database
- webserver
volumes:
- ./api:/usr/local/share/${APP_NAME}
database:
image: mysql:5.7
volumes:
- ./dbdata:/var/lib/mysql
restart: always
ports:
- ${COMPOSE_DB_PORT}:3306
webserver:
build:
context: .
dockerfile: webserver.dockerfile
working_dir: "/usr/local/share/${APP_NAME}"
volumes:
- ./api:/usr/local/share/${APP_NAME}
restart: always
ports:
- ${COMPOSE_APP_PORT}:80
It has 3 services. a website, a database and a web server which works as expected.
Now I have another separate web project which is a CMS that uses the same database as the API project and I want to add it to this docker compose file but I can't figure out how to configure the web server service to handle requests from said 2 web sites. Should I add another web server for the cms?
I searched on google but I couldn't find something clear and most results were using old docker-compose version which I'm not familiar with.
Thanks in advance.