25 lines
1.0 KiB
Markdown
25 lines
1.0 KiB
Markdown
# Vue 3 + Vite
|
||
|
||
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||
|
||
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
|
||
|
||
## Docker HTTPS 部署(Linux)
|
||
|
||
服务直接通过 HTTPS 对外提供前端、API 和 WebSocket,不占用 443 端口。部署前修改 `.env`:
|
||
|
||
```dotenv
|
||
VITE_SERVICE_PORT=5175
|
||
HTTPS_CERT_FILENAME=你的证书文件.pem
|
||
HTTPS_KEY_FILENAME=你的私钥文件-key.pem
|
||
```
|
||
|
||
证书和私钥应位于 Linux 的 `/home/cmvr/zh/mkcert` 目录中,该目录会以只读方式挂载到容器。然后执行:
|
||
|
||
```bash
|
||
docker compose up -d --build
|
||
docker compose logs -f app
|
||
```
|
||
|
||
访问地址为 `https://<Linux主机IP>:<VITE_SERVICE_PORT>`。请确保防火墙已放行该端口,并且证书包含实际访问时使用的域名或 IP。
|