From b3e92b155b913bc580ad2901ea068250de3ecbbc Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Mon, 25 Mar 2024 15:33:12 +0300 Subject: [PATCH] Fix Dockerfile. Add dotenv --- Dockerfile | 5 +++-- src/.env | 3 --- src/config.js | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 src/.env diff --git a/Dockerfile b/Dockerfile index 6cc92a60..9ceaa8eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ FROM docker.io/library/node:18-alpine AS build_node_modules RUN npm install -g npm@latest # Copy Web UI -COPY src /app +COPY src/ /app/ +COPY webui/dist/ /app/www/ WORKDIR /app RUN npm ci --omit=dev &&\ mv node_modules /node_modules @@ -44,5 +45,5 @@ RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy ENV DEBUG=Server,WireGuard # Run Web UI -WORKDIR /app/server +WORKDIR /app CMD ["/usr/bin/dumb-init", "node", "server.js"] diff --git a/src/.env b/src/.env deleted file mode 100644 index 122fe628..00000000 --- a/src/.env +++ /dev/null @@ -1,3 +0,0 @@ -WG_HOST=127.0.0.1 -UI_TRAFFIC_STATS=true -UI_CHART_TYPE=2 \ No newline at end of file diff --git a/src/config.js b/src/config.js index b76c5343..daa55cf9 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,7 @@ 'use strict'; const { release } = require('./package.json'); +require('dotenv').config(); module.exports.RELEASE = release; module.exports.PORT = process.env.PORT || '51821';