[Angular CLI] Build application without remove dist folder for Docker Volume
When we develop the Angular app inside Docker container, we can simulate Production envioment by build Angualr App instead of using 'ng serve':
ng build --watch --delete-output-path false
'--delete-output-path false': tells it do not delete the dist folder when doing the build.
nginx.dockerfile file:
FROM nginx:alpine LABEL author="Dan Wahlin" COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf # Use the following commands to build the image and run the container (run from the root folder) # 1. You'll first need to build the project using `ng build --watch --delete-output-path false` # 2. Now build the Docker image: # docker build -t nginx-angular -f nginx.dockerfile . #3. Run the Docker container: # To run the container we'll create a volume to point to our local source code. On Mac # you can use $(pwd) to reference your local folder where your running Docker commands from. # If you're on Windows there are several options to point to the folder. See my following post: # https://blog.codewithdan.com/2017/10/25/docker-volumes-and-print-working-directory-pwd/ # docker run -p 8080:80 -v $(pwd)/dist:/usr/share/nginx/html nginx-angular
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2016-04-17 [RxJS] Returning subscriptions from the subscribe function
2016-04-17 [RxJS] Creation operator: create()
2016-04-17 [RxJS] Creation operators: interval and timer