19 lines
		
	
	
		
			607 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
		
		
			
		
	
	
			19 lines
		
	
	
		
			607 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								version: '3'
							 | 
						||
| 
								 | 
							
								services:
							 | 
						||
| 
								 | 
							
								  # 服务名称
							 | 
						||
| 
								 | 
							
								  nginx:
							 | 
						||
| 
								 | 
							
								    # 镜像:版本
							 | 
						||
| 
								 | 
							
								    image: nginx:latest 
							 | 
						||
| 
								 | 
							
								    container_name: mes_web_nginx
							 | 
						||
| 
								 | 
							
								    # 映射容器80端口到本地80端口
							 | 
						||
| 
								 | 
							
								    ports:
							 | 
						||
| 
								 | 
							
								     - "80:80"
							 | 
						||
| 
								 | 
							
								    # 数据卷 映射本地文件到容器
							 | 
						||
| 
								 | 
							
								    volumes:
							 | 
						||
| 
								 | 
							
								    # 映射nginx.conf文件到容器的/etc/nginx/conf.d目录并覆盖default.conf文件
							 | 
						||
| 
								 | 
							
								    #- ./nginx.conf:/etc/nginx/conf.d/default.conf
							 | 
						||
| 
								 | 
							
								    # 映射build文件夹到容器的/usr/share/nginx/html文件夹
							 | 
						||
| 
								 | 
							
								     - ./build:/usr/share/nginx/html
							 | 
						||
| 
								 | 
							
								    # 覆盖容器启动后默认执行的命令。
							 | 
						||
| 
								 | 
							
								    command: /bin/bash -c "nginx -g 'daemon off;'" 
							 |