preparation for publication

master
Tudor Stanciu 2020-05-26 23:58:00 +03:00
parent 55d3fc3f97
commit b70435cbfa
4 changed files with 17 additions and 6 deletions

View File

@ -10,7 +10,16 @@ RUN npm run build
# production environment # production environment
FROM node:12 FROM node:12
COPY --from=builder /app/build ./build ARG APP_SUBFOLDER=reverse-proxy
RUN npm install
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 EXPOSE 80
CMD ["sh","-c","node serve -s build -p 80"]
CMD ["sh", "-c", "node serve -s application -p 80"]

View File

@ -72,7 +72,7 @@ const AboutComponent = () => {
<Typography paragraph>Method:</Typography> <Typography paragraph>Method:</Typography>
<Typography paragraph> <Typography paragraph>
Aici se va descrie tehnic si detaliat ce e un reverse proxy. Poate 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
</Typography> </Typography>
<Typography paragraph> <Typography paragraph>
Heat oil in a (14- to 16-inch) paella pan or a large, deep skillet Heat oil in a (14- to 16-inch) paella pan or a large, deep skillet

View File

@ -12,7 +12,7 @@ const store = configureStore();
render( render(
<ReduxProvider store={store}> <ReduxProvider store={store}>
<Router> <Router basename={process.env.PUBLIC_URL}>
<App /> <App />
</Router> </Router>
</ReduxProvider>, </ReduxProvider>,

View File

@ -5,6 +5,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpackBundleAnalyzer = require("webpack-bundle-analyzer"); const webpackBundleAnalyzer = require("webpack-bundle-analyzer");
process.env.NODE_ENV = "production"; process.env.NODE_ENV = "production";
process.env.PUBLIC_URL = "/reverse-proxy";
module.exports = { module.exports = {
mode: "production", mode: "production",
@ -13,7 +14,7 @@ module.exports = {
entry: "./src/index", entry: "./src/index",
output: { output: {
path: path.resolve(__dirname, "build"), path: path.resolve(__dirname, "build"),
publicPath: "/", publicPath: process.env.PUBLIC_URL,
filename: "bundle.js" filename: "bundle.js"
}, },
plugins: [ plugins: [
@ -27,6 +28,7 @@ module.exports = {
new webpack.DefinePlugin({ new webpack.DefinePlugin({
// This global makes sure React is built in prod mode. // This global makes sure React is built in prod mode.
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), "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( "process.env.REVERSE_PROXY_API_URL": JSON.stringify(
"https://toodle.ddns.net/reverse-proxy-api" "https://toodle.ddns.net/reverse-proxy-api"
) )