esteinig / cerebro

Metagenomic diagnostics stack for low abundance sample types and clinical reporting
GNU General Public License v3.0
1 stars 0 forks source link

Deployment adjustments for templates #7

Closed esteinig closed 10 months ago

esteinig commented 10 months ago

Dev deployment mode should be able to access the templates from the repository (docker-compose.yml - cerebro_api)

volumes:
  {{#if dev }}
  # Path mount for application in development
  - {{{ dev }}}:/usr/src/cerebro
  - {{{ dev }}}/templates/email:/data/templates/email:ro
  - {{{ dev }}}/templates/report:/data/templates/report:ro
  {{else}}
  # Volume mount for application in production deployment
  - cerebro_api:/data
  - {{{ outdir }}}/templates/email:/data/templates/email:ro
  - {{{ outdir }}}/templates/report:/data/templates/report:ro
  {{/if}}

Dockerfile.server that is deployed currently does not include PDF compiler testing - this is necessary to load dependent LaTeX packages so that the first report generation takes little time. However - currently the Docker container user needs to be root for this to access rott installed system dependencies for tectonic.

ENV PATH="${PATH}:/opt/cerebro/bin"
RUN cargo build --release --features pdf && cp target/release/cerebro /opt/cerebro/bin
WORKDIR /opt/cerebro

RUN cerebro report compile --base-config /usr/src/cerebro/templates/report/report.toml --output test.pdf --pdf && rm test.pdf

Perhaps we can implement sudo install of dependencies with container user and remove sudo access when built?

esteinig commented 10 months ago

This will need some more thought when deploying development versions to the web server

esteinig commented 10 months ago

Some other issues here:

esteinig commented 10 months ago

Closing this, being addressed in the larger project scope of issue #4