Angular Docker容器正在生成,但未显示项目';本地主机上的前端页面
我使用Springboot作为后端,Angular作为前端,MySQL数据库。我正在使用docker-compose.yml来运行该项目。这是我的docker撰写文件:Angular Docker容器正在生成,但未显示项目';本地主机上的前端页面,angular,spring-boot,docker-compose,Angular,Spring Boot,Docker Compose,我使用Springboot作为后端,Angular作为前端,MySQL数据库。我正在使用docker-compose.yml来运行该项目。这是我的docker撰写文件: version: '3.3' services: db: image: 'mysql:latest' container_name: mysql-db2 hostname: "sqlbox" environment: MYSQL_ROOT_PASSWORD: pass
version: '3.3'
services:
db:
image: 'mysql:latest'
container_name: mysql-db2
hostname: "sqlbox"
environment:
MYSQL_ROOT_PASSWORD: password2
ports:
- "3307:3306"
restart: always
customerservice:
image: customer-service
container_name: customer-service-app
build:
context: .
dockerfile: Backend/Dockerfile
ports:
- "8080:8080"
restart: always
depends_on:
- db
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://sqlbox:3306/testdb1?createDatabaseIfNotExist=true
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: password2
angular-service:
container_name: angularcont
build:
context: .
dockerfile: Frontend/Dockerfile
ports:
- "4201:4200"
depends_on: #define dependencies of this app
- customerservice
但是当我转到localhost:8080/或localhost:4200/时,我看不到任何页面。您的angular服务正在端口4201上运行,您尝试过吗?是的,它也不工作。