Skip to content

Commit a3585e8

Browse files
committed
created a vue.js sample
1 parent 311328a commit a3585e8

20 files changed

+1493
-1
lines changed

.DS_Store

6 KB
Binary file not shown.

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/.DS_Store

6 KB
Binary file not shown.

samples/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/vuejs/.DS_Store

6 KB
Binary file not shown.

samples/vuejs/app/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.git
3+
.gitignore

samples/vuejs/app/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar"]
3+
}

samples/vuejs/app/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use Node runtime as base image
2+
FROM node:20-alpine
3+
4+
# Set working directory to /app
5+
WORKDIR /app
6+
7+
# Copy the package.json and package-lock.json files
8+
COPY package*.json ./
9+
10+
# Install dependencies
11+
RUN npm install
12+
13+
# Copy the rest of your application's code
14+
COPY . .
15+
16+
# Expose the port your app runs on
17+
EXPOSE 5173
18+
19+
# Command to run the app when container is finished launch
20+
CMD ["npm", "run", "dev"]

samples/vuejs/app/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Vue.js
2+
3+
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/)
4+
5+
This sample shows how to get a minimal Vue.js app up and running with Defang.
6+
7+
## Essential Setup Files
8+
9+
1. A [Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) to describe the basic image of your applications.
10+
2. A [docker-compose file](https://docs.defang.io/docs/concepts/compose) to define and run multi-container Docker applications.
11+
3. A [.dockerignore](https://docs.docker.com/build/building/context/#dockerignore-files) file to comply with the size limit (10MB).
12+
13+
## Prerequisite
14+
15+
1. Download [Defang CLI](https://github.com/DefangLabs/defang)
16+
2. If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc), make sure you have properly [authenticated your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
17+
Plus, make sure that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`.
18+
19+
## Deploying
20+
21+
1. Open the terminal and type `defang login`
22+
2. Type `defang compose up` in the CLI.
23+
3. Your app will be running within a few minutes.
24+
25+
---
26+
27+
Title: Vue.js
28+
29+
Short Description: A minimal Vue.js app running on Defang.
30+
31+
Tags: Vue.js, Vite, Node.js, Frontend, JavaScript
32+
33+
Languages: javascript
34+

0 commit comments

Comments
 (0)