Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-login-page-logos
- Loading branch information
Showing
21 changed files
with
405 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,6 @@ tests | |
scripts | ||
|
||
# Docker | ||
Dockerfile | ||
docker-compose.yml | ||
Dockerfile* | ||
docker-compose.*yml | ||
volumes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,61 @@ | ||
FROM python:3.8-alpine3.12 | ||
########### | ||
# BUILDER # | ||
########### | ||
FROM python:3.8.1-slim as builder | ||
|
||
LABEL base_image="python:3.8-alpine3.12" | ||
WORKDIR /usr/src/app | ||
|
||
# Set build variables | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --no-install-recommends autoconf automake \ | ||
build-essential gcc libbz2-dev libcairo2 libcurl4-gnutls-dev \ | ||
libffi-dev libgdk-pixbuf2.0-0 liblzma-dev libpango-1.0-0 \ | ||
libpangocairo-1.0-0 libssl-dev make python3-cffi python3-dev \ | ||
python3-pip python3-wheel shared-mime-info zlib1g-dev \ | ||
openssl ca-certificates gcc wget git | ||
|
||
# Copy app | ||
COPY . /usr/src/app | ||
RUN pip install --upgrade pip && \ | ||
pip wheel --no-cache-dir --no-deps \ | ||
--wheel-dir /usr/src/app/wheels \ | ||
Cython gunicorn && \ | ||
pip wheel --no-cache-dir \ | ||
--wheel-dir /usr/src/app/wheels \ | ||
--editable .[coverage] | ||
|
||
|
||
######### | ||
# FINAL # | ||
######### | ||
|
||
FROM python:3.8.1-slim | ||
|
||
LABEL base_image="python:3.8.1-slim" | ||
LABEL about.home="https://github.com/Clinical-Genomics/scout" | ||
LABEL about.documentation="https://clinical-genomics.github.io/scout" | ||
LABEL about.tags="WGS,WES,Rare diseases,VCF,variants,SNP,Next generation sequencing" | ||
LABEL about.license="MIT License (MIT)" | ||
|
||
# Install required libs | ||
RUN apk update | ||
RUN apk --no-cache add make automake gcc g++ linux-headers libffi-dev zlib-dev \ | ||
jpeg-dev libressl-dev cairo-dev pango-dev gdk-pixbuf ttf-freefont bash | ||
RUN pip install numpy Cython | ||
|
||
# Run app on non-root user | ||
RUN useradd -m worker && mkdir -p /home/worker/app | ||
WORKDIR /home/worker/app | ||
COPY . /home/worker/app | ||
|
||
# Install scout app | ||
RUN pip install -e . | ||
# Copy pyhon wheels and install scout | ||
COPY --from=builder /usr/src/app/wheels /wheels | ||
RUN apt-get update && \ | ||
apt-get install -y libgdk-pixbuf2.0-0 libpango-1.0-0 \ | ||
libcairo2 libpangocairo-1.0-0 ssh sshfs && \ | ||
pip install --no-cache-dir --upgrade pip && \ | ||
pip install --no-cache-dir /wheels/* && \ | ||
rm -rf /var/lib/apt/lists/* /wheels | ||
|
||
COPY . /home/worker/app | ||
|
||
# Run commands as non-root user | ||
RUN adduser -D worker | ||
RUN chown worker:worker -R /home/worker | ||
# Run app on non-root user | ||
RUN chown -R worker:worker /home/worker/app | ||
USER worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Docker-compose file containing Scout demo and a running chanjo-report instance | ||
# 1) Move this file under scout/ | ||
# 2) edit scout config file and add these lines: | ||
# SQLALCHEMY_DATABASE_URI = "mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test" ? | ||
# REPORT_LANGUAGE = "en" # or 'sv' | ||
version: '3' | ||
# usage: | ||
# (sudo) docker-compose up -d | ||
# (sudo) docker-compose down | ||
services: | ||
# mongodb is used by Scout | ||
mongodb: | ||
image: mvertes/alpine-mongo | ||
container_name: mongodb | ||
ports: | ||
- '27013:27017' | ||
expose: | ||
- '27017' | ||
networks: | ||
- custom-net | ||
|
||
# MariaDB is used by Chanjo | ||
mariadb: | ||
container_name: mariadb | ||
image: mariadb:latest | ||
restart: 'always' | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=root | ||
- MYSQL_DATABASE=chanjo4_test | ||
- MYSQL_USER=chanjoUser | ||
- MYSQL_PASSWORD=chanjoPassword | ||
healthcheck: # Wait for the service to be ready before accepting incoming connections | ||
test: "mysql --user=chanjoUser --password=chanjoPassword --execute \"SHOW DATABASES;\"" | ||
timeout: 10s | ||
retries: 20 | ||
networks: | ||
- custom-net | ||
|
||
# Set up chanjo database and load some demo data | ||
chanjo-cli: | ||
container_name: chanjo-cli | ||
image: clinicalgenomics/chanjo | ||
depends_on: | ||
mariadb: | ||
condition: service_healthy # DB_URI=mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test | ||
networks: | ||
- custom-net | ||
command: bash -c " | ||
chanjo -d mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test db setup --reset | ||
&& chanjo -d mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test init --auto demodata | ||
&& chanjo --config demodata/chanjo.yaml link demodata/hgnc.grch37p13.exons.bed | ||
&& chanjo -d mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test load -n sample1 --group-name test_group -g test_group chanjo/init/demo-files/sample1.coverage.bed | ||
&& chanjo -d mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test load -n sample2 --group-name test_group -g test_group chanjo/init/demo-files/sample2.coverage.bed | ||
&& chanjo -d mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test load -n sample3 --group-name test_group -g test_group chanjo/init/demo-files/sample3.coverage.bed" | ||
|
||
# Start the chanjo-report app | ||
chanjo-report: | ||
container_name: chanjo-report | ||
expose: | ||
- '5000' | ||
ports: | ||
- '4000:5000' | ||
image: clinicalgenomics/chanjo-report | ||
depends_on: | ||
- mariadb | ||
- chanjo-cli | ||
networks: | ||
- custom-net | ||
entrypoint: sh -c "chanjo -d mysql+pymysql://chanjoUser:chanjoPassword@mariadb/chanjo4_test report --render html" | ||
|
||
# Start the scout app containing demo data | ||
scout-web: | ||
image: clinicalgenomics/scout:latest | ||
container_name: scout-web | ||
expose: | ||
- '5000' | ||
ports: | ||
- '5000:5000' | ||
command: bash -c " | ||
scout --host mongodb setup demo | ||
&& scout --host mongodb --demo serve --host 0.0.0.0" | ||
volumes: | ||
- ./scout:/home/worker/app/scout | ||
- ./volumes/scout/data:/home/worker/data | ||
depends_on: | ||
- mongodb | ||
- chanjo-report | ||
networks: | ||
- custom-net | ||
|
||
networks: | ||
custom-net: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 172.21.0.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.