From 2e9525350a43a7d95c2b996bd0ec24c2ae46242d Mon Sep 17 00:00:00 2001 From: dannc Date: Mon, 3 Apr 2023 09:59:39 +0700 Subject: [PATCH] [feature] add version route --- Dockerfile | 2 ++ nginx/templates/default.conf.template | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7777f9e..e570956 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,5 +11,7 @@ RUN npm run-script build FROM nginx:1.23.2 as runtume +ENV APP_VERSION=latest + COPY ./nginx/templates /etc/nginx/templates COPY --from=build /opt/neko/dist /opt/neko/dist diff --git a/nginx/templates/default.conf.template b/nginx/templates/default.conf.template index fd59286..8d5ac66 100644 --- a/nginx/templates/default.conf.template +++ b/nginx/templates/default.conf.template @@ -14,4 +14,9 @@ server { root /opt/neko/dist; index index.html; } + + location /version { + default_type application/json; + return 200 '{"version": "$APP_VERSION"}'; + } }