-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
@giorgiosironi The problem is, that the However, it seems we should probably already include the bundled JavaScript in some container. We just need to inject the HTML into the |
Maybe the xpub people know of a solution as they integrated New Relic as well. There's ids derived from the account in the generated HTML/JavaScript so I'd avoid building it into the image as it should be configuration. We may have to mount an HTML file or a fragment of it as a volume? |
Yes, mounting the HTML fragements (that we already provide). It's just the small "script" (or similar) that bakes it into the correct place of the @diversemix how do you manage that in xpub? |
Because we are a SPA ... then its quite simple for us... https://github.com/elifesciences/elife-xpub/blob/cbb9bb9067d688090ea482cb634846dad4a61602/app.js#L1 The
You could make the configuration then pull from the environment. We don't do this with the new relic config but do do it for other variables in config. |
Okay, thank you. I am guessing that is hooking into the |
Will implement the use of html fragments separately #387 |
@@ -26,7 +26,7 @@ ARG install_dev | |||
COPY requirements.dev.txt ./ | |||
RUN if [ "${install_dev}" = "y" ]; then pip install -r requirements.dev.txt; fi | |||
|
|||
COPY --from=client --chown=elife:elife /home/node/client/ ${PROJECT_FOLDER}/client/ | |||
COPY --from=client --chown=elife:elife /home/node/client/dist/ ${PROJECT_FOLDER}/client/dist/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need dist
when running the server (no need to copy node_modules
& co)
@@ -35,7 +35,7 @@ COPY --chown=elife:elife app-defaults.cfg ${PROJECT_FOLDER}/ | |||
|
|||
USER root | |||
RUN mkdir .data && chown www-data:www-data .data | |||
RUN mkdir logs && chown www-data:www-data logs | |||
RUN mkdir logs && chown www-data:www-data logs && chmod -R a+w logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be www-data
and elife
writing to the logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be just www-data
if we run everything in the container? But fine to keep this backward compatibility if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image is (or would be) used to run the server as well as the "ETL" scripts (migrate schema, load data etc.). The latter is currently meant to be run via the elife
user. But we could use www-data
for both if you think that would be better.
@giorgiosironi any objections to merging this PR? |
dockerfile: Dockerfile | ||
image: elifesciences/peerscout_init:${IMAGE_TAG} | ||
volumes: | ||
- config-aws:/home/elife/volume-config-aws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some weird copying from one folder to the other to avoid ownership clashes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem with that, but why needing a volume if the copying is executed every time the container starts anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find that when the container is not run as root or the developer's user, then just mounting the credentials won't work because the permissions are meant to set up that only the user can read them. This makes the developers credentials available via the volume. (The init container is run as root, and therefore has permissions)
One alternative would maybe be to run the container using the developer's user (which seem to also be more complicated than it should). I experimented with a few approaches across the projects. Not sure which one is best. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular objections
Also updated the base image because the previous base Python image had |
No description provided.