new version

master
Tudor Stanciu 2021-09-08 09:40:22 +03:00
parent c4740f9b0d
commit 743fff5cce
3 changed files with 24 additions and 17 deletions

View File

@ -1,6 +1,6 @@
{
"name": "reverse-proxy-frontend",
"version": "1.0.0",
"version": "1.0.5",
"private": true,
"description": "Reverse proxy frontend application",
"scripts": {

View File

@ -4,35 +4,35 @@ Docker commands:
Create image:
--from solution folder:
docker image build -t "reverse-proxy-frontend:1.0.2" .
docker image build -t "reverse-proxy-frontend:1.0.5" .
Run image:
docker run -p 5055:80 -it reverse-proxy-frontend:1.0.2
docker run -p 5055:80 -it reverse-proxy-frontend:1.0.5
Push image to registry:
--tag image
docker tag reverse-proxy-frontend:1.0.2 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
docker tag reverse-proxy-frontend:1.0.5 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5
--login to registry
docker login --username=admin --password="***REMOVED***" alpine-nexus:8500
--push image
docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
docker push alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5
Pull image from registry
--login to registry
--pull image
docker pull alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
docker pull alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5
Stop old container
docker stop reverse-proxy-frontend && docker rm reverse-proxy-frontend
Run container in prod env
docker run -d --name reverse-proxy-frontend --restart=always -p 5005:80 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
docker run -d --name reverse-proxy-frontend --restart=always -p 5005:80 alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.5
Remove old image
docker rmi alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.1
docker rmi alpine-nexus:8500/reverse-proxy/reverse-proxy-frontend:1.0.2
Get container logs
docker logs reverse-proxy-frontend

View File

@ -4,15 +4,9 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpackBundleAnalyzer = require("webpack-bundle-analyzer");
const CopyPlugin = require("copy-webpack-plugin");
const config = require("./config");
process.env.NODE_ENV = config.prod.NODE_ENV;
process.env.PUBLIC_URL = config.prod.PUBLIC_URL;
let configs = {};
Object.keys(config.dev).forEach(z => {
configs[`process.env.${z}`] = JSON.stringify(config.dev[z]);
});
process.env.NODE_ENV = "production";
process.env.PUBLIC_URL = "/reverse-proxy";
module.exports = {
mode: "production",
@ -32,7 +26,20 @@ module.exports = {
filename: "[name].[contenthash].css"
}),
new webpack.DefinePlugin(configs),
new webpack.DefinePlugin({
// This global makes sure React is built in prod mode.
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
"process.env.PUBLIC_URL": JSON.stringify(process.env.PUBLIC_URL),
"process.env.REVERSE_PROXY_API_URL": JSON.stringify(
"https://toodle.ddns.net/reverse-proxy-api"
),
"process.env.CHATBOT_API_URL": JSON.stringify(
"https://toodle.ddns.net/chatbot-api"
),
"process.env.REVERSE_PROXY_DOCS_URL": JSON.stringify(
"https://toodle.ddns.net/docs/books/reverse-proxy"
)
}),
new HtmlWebpackPlugin({
template: "src/index.html",
favicon: "src/favicon.ico",