version : '2' services: web: build: context: . dockerfile: web.dockerfile volumes: - ./log/web/:/var/log/apache2/ ports: - '8080:80' - '8081:443' depends_on: - db #use links keywoard to use db as a known host "db" to connect to database links: - db db: build: context: . dockerfile: mysql.dockerfile ports: - '23306:3306'