Skip to content

Commit 753ec76

Browse files
[fix] apply minor fixes and cleanup
1 parent 6a4d927 commit 753ec76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

content/guides/angular/containerize.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ After completion, your project directory will contain the following new files:
101101

102102
The default Dockerfile generated by `docker init` serves as a solid starting point for general Node.js applications. However, Angular is a front-end framework that compiles into static assets, so we need to tailor the Dockerfile to optimize for how Angular applications are built and served in a production environment.
103103

104-
### Step 1: Review the generated files
104+
### Step 1: Improve the generated Dockerfile and configuration
105105

106106
In this step, you’ll improve the Dockerfile and configuration files by following best practices:
107107

@@ -172,6 +172,13 @@ ENTRYPOINT ["nginx", "-c", "/etc/nginx/nginx.conf"]
172172
CMD ["-g", "daemon off;"]
173173
```
174174

175+
> [!NOTE]
176+
> We are using nginx-unprivileged instead of the standard NGINX image to follow security best practices.
177+
> Running as a non-root user in the final image:
178+
>- Reduces the attack surface
179+
>- Aligns with Docker’s recommendations for container hardening
180+
>- Helps comply with stricter security policies in production environments
181+
175182
### Step 3: Configure the .dockerignore file
176183

177184
The `.dockerignore` file tells Docker which files and folders to exclude when building the image.
@@ -286,7 +293,6 @@ http {
286293
287294
# Compression
288295
gzip on;
289-
gzip_disable "msie6";
290296
gzip_vary on;
291297
gzip_proxied any;
292298
gzip_min_length 256;

0 commit comments

Comments
 (0)