Skip to content

Commit f7079f2

Browse files
[feat] improve docker vuejs docs guide
1 parent b59dc6b commit f7079f2

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

content/guides/angular/develop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ WORKDIR /app
5353
COPY package.json package-lock.json ./
5454

5555
# Install dependencies using npm with caching to speed up subsequent builds
56-
RUN --mount=type=cache,target=/root/.npm npm ci
56+
RUN --mount=type=cache,target=/root/.npm npm install
5757

5858
# Copy all application source files into the container
5959
COPY . .

content/guides/vuejs/_index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ params:
1515

1616
The Vue.js language-specific guide shows you how to containerize an Vue.js application using Docker, following best practices for creating efficient, production-ready containers.
1717

18-
[Vue.js](https://vuejs.org/) Vue.js is a progressive and flexible framework for building modern, interactive web applications. Its simplicity and modularity make it ideal for projects of any size, from small prototypes to large-scale enterprise solutions. However, as applications grow, managing dependencies, configuring environments, and handling deployments can become increasingly intricate. Docker addresses these complexities by providing a consistent, containerized environment that simplifies development, testing, and production workflows.
18+
[Vue.js](https://vuejs.org/) is a progressive and flexible framework for building modern, interactive web applications. However, as applications scale, managing dependencies, environments, and deployments can become complex. Docker simplifies these challenges by providing a consistent, isolated environment for both development and production.
1919

2020
>
2121
> **Acknowledgment**
2222
>
23-
> Docker extends its sincere gratitude to [Kristiyan Velkov](https://www.linkedin.com/in/kristiyan-velkov-763130b3/) for authoring this comprehensive guide. As a respected Docker Captain and seasoned Front-end Engineer, Kristiyan brings deep expertise in Docker, DevOps, and modern web development. His commitment to clarity and best practices has made this guide an invaluable resource—empowering developers to streamline, optimize, and master their Docker workflows with confidence.
24-
23+
> Docker extends its sincere gratitude to [Kristiyan Velkov](https://www.linkedin.com/in/kristiyan-velkov-763130b3/) for authoring this guide. As a Docker Captain and highly skilled Front-end engineer, Kristiyan brings exceptional expertise in modern web development, Docker, and DevOps. His hands-on approach and clear, actionable guidance make this guide an essential resource for developers aiming to build, optimize, and secure Vue.js applications with Docker.
2524
---
2625

2726
## What will you learn?

content/guides/vuejs/configure-ci-cd.md renamed to content/guides/vuejs/configure-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Configure CI/CD for your Vue.js application
3-
linkTitle: Configure CI/CD
2+
title: Automate your builds with GitHub Actions
3+
linkTitle: Automate your builds with GitHub Actions
44
weight: 60
55
keywords: CI/CD, GitHub( Actions), Vue.js
66
description: Learn how to configure CI/CD using GitHub Actions for your Vue.js application.

content/guides/vuejs/containerize.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ FROM node:${NODE_VERSION} AS builder
134134
WORKDIR /app
135135

136136
# Copy package-related files first to leverage Docker's caching mechanism
137-
COPY --link package.json package-lock.json ./
137+
COPY package.json package-lock.json ./
138138

139139
# Install project dependencies using npm ci (ensures a clean, reproducible install)
140-
RUN npm ci
140+
RUN --mount=type=cache,target=/root/.npm npm ci
141141

142142
# Copy the rest of the application source code into the container
143-
COPY --link . .
143+
COPY . .
144144

145145
# Build the Vue.js application
146146
RUN npm run build
@@ -155,11 +155,11 @@ FROM nginxinc/nginx-unprivileged:${NGINX_VERSION} AS runner
155155
USER nginx
156156

157157
# Copy custom Nginx config
158-
COPY --link nginx.conf /etc/nginx/nginx.conf
158+
COPY nginx.conf /etc/nginx/nginx.conf
159159

160160

161161
# Copy the static build output from the build stage to Nginx's default HTML serving directory
162-
COPY --link --from=builder /app/dist /usr/share/nginx/html
162+
COPY --chown=nginx:nginx --from=builder /app/dist /usr/share/nginx/html
163163

164164
# Expose port 8080 to allow HTTP traffic
165165
# Note: The default NGINX container now listens on port 8080 instead of 80
@@ -373,7 +373,7 @@ What this command does:
373373
- Tags the image as docker-vuejs-sample so you can reference it later
374374

375375

376-
#### Step 6: View local images
376+
#### Step 6: View local images
377377

378378
After building your Docker image, you can check which images are available on your local machine using either the Docker CLI or [Docker Desktop](/manuals/desktop/use-desktop/images.md). Since you're already working in the terminal, let's use the Docker CLI.
379379

content/guides/vuejs/deploy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Test your Vue.js deployment
33
linkTitle: Test your deployment
44
weight: 60
5-
keywords: deploy, kubernetes, vuejs
5+
keywords: deploy, kubernetes, vue, vue.js
66
description: Learn how to deploy locally to test and debug your Kubernetes deployment
77

88
---
@@ -32,7 +32,7 @@ Follow these steps to define your deployment configuration:
3232

3333
2. Open the file in your IDE or preferred text editor.
3434

35-
3. Add the following configuration, and be sure to replace `{DOCKER_USERNAME}` and `{DOCKERHUB_PROJECT_NAME}` with your actual Docker Hub username and repository name from the previous [Configure CI/CD for your Vue.js application](configure-ci-cd.md).
35+
3. Add the following configuration, and be sure to replace `{DOCKER_USERNAME}` and `{DOCKERHUB_PROJECT_NAME}` with your actual Docker Hub username and repository name from the previous [Automate your builds with GitHub Actions](configure-github-actions.md).
3636

3737

3838
```yaml
@@ -84,7 +84,7 @@ This manifest defines two key Kubernetes resources, separated by `---`:
8484

8585
- Deployment
8686
Deploys a single replica of your Vue.js application inside a pod. The pod uses the Docker image built and pushed by your GitHub Actions CI/CD workflow
87-
(refer to [Configure CI/CD for your Vue.js application](configure-ci-cd.md)).
87+
(refer to [Automate your builds with GitHub Actions](configure-github-actions.md)).
8888
The container listens on port `8080`, which is typically used by [Nginx](https://nginx.org/en/docs/) to serve your production Vue.js app.
8989

9090
- Service (NodePort)

content/guides/vuejs/develop.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,20 @@ ARG NODE_VERSION=22.14.0-alpine
4343
# Use a lightweight Node.js image for development
4444
FROM node:${NODE_VERSION} AS dev
4545

46+
# Set environment variable to indicate development mode
47+
ENV NODE_ENV=development
48+
4649
# Set the working directory inside the container
4750
WORKDIR /app
4851

4952
# Copy package-related files first to leverage Docker's caching mechanism
50-
COPY --link package.json package-lock.json ./
53+
COPY package.json package-lock.json ./
5154

5255
# Install project dependencies
5356
RUN --mount=type=cache,target=/root/.npm npm install
5457

5558
# Copy the rest of the application source code into the container
56-
COPY --link . .
59+
COPY . .
5760

5861
# Expose the port used by the Vite development server
5962
EXPOSE 5173

content/guides/vuejs/run-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ After completing the previous steps, your project directory should contain the f
8484
│ └── README.Docker.md
8585
```
8686

87-
### Step 4: Run the tests
87+
### Step 2: Run the tests
8888

8989
To execute your test suite inside the container, run the following command from your project root:
9090

0 commit comments

Comments
 (0)