new version
parent
c4740f9b0d
commit
743fff5cce
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "reverse-proxy-frontend",
|
"name": "reverse-proxy-frontend",
|
||||||
"version": "1.0.0",
|
"version": "1.0.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Reverse proxy frontend application",
|
"description": "Reverse proxy frontend application",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -4,35 +4,35 @@ Docker commands:
|
||||||
|
|
||||||
Create image:
|
Create image:
|
||||||
--from solution folder:
|
--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:
|
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:
|
Push image to registry:
|
||||||
--tag image
|
--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
|
--login to registry
|
||||||
docker login --username=admin --password="***REMOVED***" alpine-nexus:8500
|
docker login --username=admin --password="***REMOVED***" alpine-nexus:8500
|
||||||
|
|
||||||
--push image
|
--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
|
Pull image from registry
|
||||||
--login to registry
|
--login to registry
|
||||||
|
|
||||||
--pull image
|
--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
|
Stop old container
|
||||||
docker stop reverse-proxy-frontend && docker rm reverse-proxy-frontend
|
docker stop reverse-proxy-frontend && docker rm reverse-proxy-frontend
|
||||||
|
|
||||||
Run container in prod env
|
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
|
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
|
Get container logs
|
||||||
docker logs reverse-proxy-frontend
|
docker logs reverse-proxy-frontend
|
||||||
|
|
|
@ -4,15 +4,9 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||||
const webpackBundleAnalyzer = require("webpack-bundle-analyzer");
|
const webpackBundleAnalyzer = require("webpack-bundle-analyzer");
|
||||||
const CopyPlugin = require("copy-webpack-plugin");
|
const CopyPlugin = require("copy-webpack-plugin");
|
||||||
const config = require("./config");
|
|
||||||
|
|
||||||
process.env.NODE_ENV = config.prod.NODE_ENV;
|
process.env.NODE_ENV = "production";
|
||||||
process.env.PUBLIC_URL = config.prod.PUBLIC_URL;
|
process.env.PUBLIC_URL = "/reverse-proxy";
|
||||||
|
|
||||||
let configs = {};
|
|
||||||
Object.keys(config.dev).forEach(z => {
|
|
||||||
configs[`process.env.${z}`] = JSON.stringify(config.dev[z]);
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: "production",
|
mode: "production",
|
||||||
|
@ -32,7 +26,20 @@ module.exports = {
|
||||||
filename: "[name].[contenthash].css"
|
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({
|
new HtmlWebpackPlugin({
|
||||||
template: "src/index.html",
|
template: "src/index.html",
|
||||||
favicon: "src/favicon.ico",
|
favicon: "src/favicon.ico",
|
||||||
|
|
Loading…
Reference in New Issue