From b70435cbfa98d1ce81adaa02580a12e3e4f9a26f Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Tue, 26 May 2020 23:58:00 +0300 Subject: [PATCH] preparation for publication --- Dockerfile | 15 ++++++++++++--- src/features/about/components/AboutComponent.js | 2 +- src/index.js | 2 +- webpack.config.prod.js | 4 +++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c6d2b2..c4571e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,16 @@ RUN npm run build # production environment FROM node:12 -COPY --from=builder /app/build ./build -RUN npm install +ARG APP_SUBFOLDER=reverse-proxy + +COPY --from=builder /app/build ./application/${APP_SUBFOLDER} +COPY --from=builder /app/build/index.html ./application/ + +#install static server +RUN npm install -g serve + +#set workdir to root +WORKDIR / EXPOSE 80 -CMD ["sh","-c","node serve -s build -p 80"] + +CMD ["sh", "-c", "node serve -s application -p 80"] diff --git a/src/features/about/components/AboutComponent.js b/src/features/about/components/AboutComponent.js index df9f7e8..a07f090 100644 --- a/src/features/about/components/AboutComponent.js +++ b/src/features/about/components/AboutComponent.js @@ -72,7 +72,7 @@ const AboutComponent = () => { Method: Aici se va descrie tehnic si detaliat ce e un reverse proxy. Poate - contine si o poza. + contine si o poza. Link catre swagger pe undeva Heat oil in a (14- to 16-inch) paella pan or a large, deep skillet diff --git a/src/index.js b/src/index.js index ec12c83..8b2f7c5 100644 --- a/src/index.js +++ b/src/index.js @@ -12,7 +12,7 @@ const store = configureStore(); render( - + , diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 8e9d388..e28b897 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -5,6 +5,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const webpackBundleAnalyzer = require("webpack-bundle-analyzer"); process.env.NODE_ENV = "production"; +process.env.PUBLIC_URL = "/reverse-proxy"; module.exports = { mode: "production", @@ -13,7 +14,7 @@ module.exports = { entry: "./src/index", output: { path: path.resolve(__dirname, "build"), - publicPath: "/", + publicPath: process.env.PUBLIC_URL, filename: "bundle.js" }, plugins: [ @@ -27,6 +28,7 @@ module.exports = { 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" )