Skip to content

Commit

Permalink
Merge a3409af into 4f74f1c
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodbare committed Sep 20, 2018
2 parents 4f74f1c + a3409af commit c0a0edf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -14,7 +14,7 @@ COPY . .
RUN yarn build

ENV API_PATH http://api/db/web
ENV API guillotina
ENV PUBLIC_URL /

ENTRYPOINT ["/opt/app/entrypoint.sh"]
CMD yarn start
4 changes: 2 additions & 2 deletions entrypoint.sh
Expand Up @@ -7,10 +7,10 @@ function apply_path {

echo "Check that we have API_PATH and API vars"
test -n "$API_PATH"
test -n "$API"
test -n "$PUBLIC_URL"

sed -i "s#PLONE_REACT_API_PATH#${API_PATH}#g" $mainjs
sed -i "s#PLONE_REACT_API_SERVICE#${API}#g" $mainjs
sed -i "s#PLONE_REACT_PUBLIC_URL#${PUBLIC_URL}#g" $mainjs

gzip -fk $mainjs
}
Expand Down
1 change: 1 addition & 0 deletions src/client.jsx
Expand Up @@ -26,6 +26,7 @@ persistAuthToken(store);
hydrate(
<Provider store={store} key="provider">
<Router
basename={process.env.PUBLIC_URL}
render={props => <ReduxAsyncConnect helpers={{ api }} {...props} />}
history={history}
>
Expand Down
2 changes: 2 additions & 0 deletions src/config/index.js
Expand Up @@ -39,11 +39,13 @@ export default defaults(
host: process.env.HOST,
port: process.env.PORT,
apiPath: process.env.API_PATH,
publicUrl: process.env.PUBLIC_URL,
},
{
host: 'localhost',
port: '4300',
apiPath: 'http://localhost:8080/Plone', // for Plone
publicUrl: '/',
// apiPath: 'http://localhost:8081/db/web', // for guillotina
},
);
3 changes: 2 additions & 1 deletion webpack/webpack.config.client.prod.js
Expand Up @@ -11,7 +11,8 @@ configuration.plugins.push(
BABEL_ENV: JSON.stringify('production/client'),
HOST: process.env.HOST && process.env.HOST,
PORT: process.env.PORT,
API_PATH: process.env.API_PATH ? JSON.stringify(process.env.API_PATH) : 'PLONE_REACT_API_PATH',
API_PATH: process.env.API_PATH ? JSON.stringify(process.env.API_PATH) : '"PLONE_REACT_API_PATH"',
PUBLIC_URL: process.env.PUBLIC_URL ? JSON.stringify(PUBLIC_URL) : '"PLONE_REACT_PUBLIC_URL"'
// SENTRY_DSN - Enable Sentry error reporting
// You need to pass the (public) Sentry DSN for JS Raven to work
// Uncomment the next lines and replace the value with the DSN for your Sentry project
Expand Down
1 change: 1 addition & 0 deletions webpack/webpack.config.server.dev.js
Expand Up @@ -11,6 +11,7 @@ configuration.plugins.push(
HOST: process.env.HOST && process.env.HOST,
PORT: process.env.PORT,
API_PATH: process.env.API_PATH && JSON.stringify(process.env.API_PATH),
PUBLIC_URL: process.env.PUBLIC_URL && JSON.stringify(process.env.PUBLIC_URL),
},
__CLIENT__: false,
__SERVER__: true,
Expand Down
3 changes: 2 additions & 1 deletion webpack/webpack.config.server.prod.js
Expand Up @@ -10,7 +10,8 @@ configuration.plugins.push(
BABEL_ENV: JSON.stringify('production/server'),
HOST: process.env.HOST && process.env.HOST,
PORT: process.env.PORT,
API_PATH: process.env.API_PATH ? JSON.stringify(process.env.API_PATH) : 'PLONE_REACT_API_PATH',
API_PATH: process.env.API_PATH ? JSON.stringify(process.env.API_PATH) : '"PLONE_REACT_API_PATH"',
PUBLIC_URL: process.env.PUBLIC_URL ? JSON.stringify(PUBLIC_URL) : '"PLONE_REACT_PUBLIC_URL"'
// SENTRY_DSN - Enable Sentry error reporting
// You need the full Sentry DSN (private) configured here for Node Raven to work
// Uncomment the next lines and replace the value with the private DSN for your Sentry project
Expand Down

0 comments on commit c0a0edf

Please sign in to comment.