Ver Fonte

feat:配置

shenchunlv há 1 ano atrás
pai
commit
c9d12a859e
3 ficheiros alterados com 22 adições e 1 exclusões
  1. 6 0
      Dockerfile
  2. 14 0
      docker-app-compose.yml
  3. 2 1
      package.json

+ 6 - 0
Dockerfile

@@ -0,0 +1,6 @@
+FROM nginx:1.16
+
+ENV TZ="Asia/Shanghai"
+ENV NGINX_PORT=80
+EXPOSE ${NGINX_PORT}
+COPY dist/  /usr/share/nginx/html/

+ 14 - 0
docker-app-compose.yml

@@ -0,0 +1,14 @@
+version: '3'
+services:
+  loan-hrsk-pages:                      # 指定服务的名称
+    image: "loan-hrsk-pages:${app_tag_name}"                         # 镜像名 .注意:${app_tag_name} 变量名不能带'-'符号,第一个'-'后会认为是默认值,而非变量名的一部分。
+    restart: always
+    environment:                        # 环境变量
+      - VIRTUAL_HOST=''          # nginx-proxy 所用域名
+    networks:                           # 网络 (用于容器间通信)
+      - nginx-proxy
+
+networks:                               # 定义网络
+  nginx-proxy:
+    external:
+      name: nginx-proxy

+ 2 - 1
package.json

@@ -6,7 +6,8 @@
     "generate": "nuxt generate",
     "preview": "nuxt preview",
     "postinstall": "nuxt prepare",
-    "start": "nuxt start"
+    "start": "nuxt start",
+    "starts": "node .output/server/index.mjs"
   },
   "devDependencies": {
     "@huntersofbook/naive-ui-nuxt": "^0.7.1",