Skip to content

Commit

Permalink
build laf-web && docker deploy (#147)
Browse files Browse the repository at this point in the history
* fix: goto app-console

* chore: build && docker deploy

* docs: add readme
  • Loading branch information
walle233 authored Jun 23, 2022
1 parent 8efa257 commit c55e660
Show file tree
Hide file tree
Showing 16 changed files with 13,238 additions and 4,286 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ services:
networks:
- laf_shared_network

system-client:
build: ./packages/system-client
laf-web:
build: ./packages/web
volumes:
- ./packages/system-client/dist:/app
- ./packages/web/dist:/app
networks:
- laf_shared_network

Expand Down
2 changes: 1 addition & 1 deletion packages/gateway/conf.docker/system.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ server {
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript image/jpeg image/gif image/png application/json font/ttf font/otf image/svg+xml;

location / {
proxy_pass http://system-client:8080/;
proxy_pass http://laf-web:8080/;
}

location /app-console/ {
Expand Down
4 changes: 3 additions & 1 deletion packages/web/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# just a flag
ENV = 'development'

VITE_APP_CONSOLE_URI = 'http://localhost:9528/app-console'
PORT = 9527

VITE_APP_CONSOLE_URI = 'http://localhost:9528/app-console'
2 changes: 1 addition & 1 deletion packages/web/.env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# just a flag
ENV = 'production'

VITE_APP_CONSOLE_URI = '/app-console'
VITE_APP_CONSOLE_URI = '/app-console'
2 changes: 2 additions & 0 deletions packages/web/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ NODE_ENV = production

# just a flag
ENV = 'staging'

VITE_APP_APP_CONSOLE_URI = '/app-console'
6 changes: 6 additions & 0 deletions packages/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM bitnami/openresty:latest

WORKDIR /app
EXPOSE 8080

ADD ./dist /app/
97 changes: 25 additions & 72 deletions packages/web/README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,40 @@
<p align='center'>
<img src='https://user-images.githubusercontent.com/11247099/111864893-a457fd00-899e-11eb-9f05-f4b88987541d.png' alt='Vitesse - Opinionated Vite Starter Template' width='600'/>
</p>
## laf-web

<h6 align='center'>
<a href="https://vitesse-lite.netlify.app/">Live Demo</a>
</h6>
`laf-web` 是 Laf 开发运维控制台客户端。

<h5 align='center'>
<b>Lightweight version of <a href="https://github.com/antfu/vitesse">Vitesse</a></b>
</h5>

<br>
## 开发

<p align='center'>
<b>English</b> | <a href="https://github.com/antfu/vitesse-lite/blob/main/README.zh-CN.md">简体中文</a>
<!-- Contributors: Thanks for geting interested, however we DON'T accept new transitions to the README, thanks. -->
</p>

## Features

- ⚡️ [Vue 3](https://github.com/vuejs/vue-next), [Vite 2](https://github.com/vitejs/vite), [pnpm](https://pnpm.js.org/), [ESBuild](https://github.com/evanw/esbuild) - born with fastness

- 🗂 [File based routing](./src/pages)

- 📦 [Components auto importing](./src/components)

- 🎨 [UnoCSS](https://github.com/antfu/unocss) - The instant on-demand atomic CSS engine.

- 😃 Use icons from any icon sets in [Pure CSS](https://github.com/antfu/unocss/tree/main/packages/preset-icons)

- 🔥 Use the [new `<script setup>` style](https://github.com/vuejs/rfcs/pull/227)

- ✅ Use [Vitest](http://vitest.dev/) for unit and components testing

- 🦾 TypeScript, of course

- ☁️ Deploy on Netlify, zero-config


<br>

See [Vitesse](https://github.com/antfu/vitesse) for full featureset.


## Dropped Features from [Vitesse](https://github.com/antfu/vitesse)

- ~~i18n~~
- ~~Layouts~~
- ~~SSG~~
- ~~PWA~~
- ~~Markdown~~

## Pre-packed

### UI Frameworks

- [UnoCSS](https://github.com/antfu/unocss) - The instant on-demand atomic CSS engine.
```bash
# 进入项目目录
cd packages/web

### Icons
# 安装依赖
pnpm install

- [Iconify](https://iconify.design) - use icons from any icon sets [🔍Icônes](https://icones.netlify.app/)
- [Pure CSS Icons via UnoCSS](https://github.com/antfu/unocss/tree/main/packages/preset-icons)
# 启动服务
pnpm run dev
```

### Plugins
浏览器访问 http://localhost:9527

- [Vue Router](https://github.com/vuejs/vue-router)
- [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages) - file system based routing
- [`unplugin-auto-import`](https://github.com/antfu/unplugin-auto-import) - Directly use Vue Composition API and others without importing
- [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components) - components auto import
- [VueUse](https://github.com/antfu/vueuse) - collection of useful composition APIs
## 发布

## Try it now!
```bash

### GitHub Template
# 构建生产环境
pnpm run build
```

[Create a repo from this template on GitHub](https://github.com/antfu/vitesse-lite/generate).
## 其它

### Clone to local
```bash
# 预览发布环境效果
npm run preview

If you prefer to do it manually with the cleaner git history
# 代码格式检查
npm run lint

```bash
npx degit antfu/vitesse-lite my-vitesse-app
cd my-vitesse-app
pnpm i # If you don't have pnpm installed, run: npm install -g pnpm
# 代码格式检查并自动修复
npm run lint -- --fix
```
2 changes: 2 additions & 0 deletions packages/web/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ declare global {
const useAttrs: typeof import('vue')['useAttrs']
const useBase64: typeof import('@vueuse/core')['useBase64']
const useBattery: typeof import('@vueuse/core')['useBattery']
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
Expand Down Expand Up @@ -157,6 +158,7 @@ declare global {
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
const useI18n: typeof import('vue-i18n')['useI18n']
const useIdle: typeof import('@vueuse/core')['useIdle']
const useImage: typeof import('@vueuse/core')['useImage']
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
const useInterval: typeof import('@vueuse/core')['useInterval']
Expand Down
2 changes: 1 addition & 1 deletion packages/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" href="https://www.lafyun.com/logo.png" type="image/svg+xml">
<title>Laf 云开发</title>
<meta name="description" content="Opinionated Vite Starter Template">
</head>
Expand Down
Loading

0 comments on commit c55e660

Please sign in to comment.