Skip to content

Commit

Permalink
Merge all dev, prod, pre-prod code. Use docker compose profiles to bu…
Browse files Browse the repository at this point in the history
…ild and start the correct containers
  • Loading branch information
pascalaldo committed Dec 11, 2024
1 parent 094460d commit 1329b5e
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:

jobs:
deployment:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Copy files using SCP
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.PANKB_PREPROD_HOST }}
username: ${{ secrets.PANKB_PREPROD_SSH_USERNAME }}
Expand All @@ -22,7 +22,7 @@ jobs:
target: "/projects/pankb_web/django_project"

- name: Create the .env file and (re-)start containers over SSH
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.PANKB_PREPROD_HOST }}
username: ${{ secrets.PANKB_PREPROD_SSH_USERNAME }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-prod-to-azurevm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:

jobs:
deployment:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Copy files using SCP
uses: appleboy/scp-action@master
uses: appleboy/scp-action@@v0.1.7
with:
host: ${{ secrets.PANKB_PROD_HOST }}
username: ${{ secrets.PANKB_PROD_SSH_USERNAME }}
Expand All @@ -22,7 +22,7 @@ jobs:
target: "/projects/pankb_web/django_project"

- name: Create the .env file and (re-)start containers over SSH
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@@v0.1.7
with:
host: ${{ secrets.PANKB_PROD_HOST }}
username: ${{ secrets.PANKB_PROD_SSH_USERNAME }}
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
=======

## PanKB v3.1.0 - 10.12.2024
- Removed djongo as a dependency
- Upgraded to django v5.1
- Used multiple gunicorn workers

## PanKB v3.0.0 - 10.12.2024
- Improved layout/styling
- Improved interfacing between the Pipeline, Azure and MongoDB.
- Improved handling of isolation sources/countries.
- Integration of Aaron’s improved phylotree.
- Improved KEGG pathway links.
- iModulonDB interoperability and NCBI locus tag mapping.
- Dynamic loading + server side processing of large datatables.
- Search now immediately loads all other results, whilst the genes table shows a loading symbol.
- Added a “Genomes” page for each species.
- Improved loading speeds for many pages, including the overview pages for species.
- Added a panning mode to the phylotree to enable users to navigate the tree more easily.
- Many small improvements...


## PanKB v2.0.0 - 15.07.2024

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PanKB Website (PROD)
# PanKB Website
<b>The dynamic Python-based version of the website. The Django framework is used as the back-end. Data about organisms, genes, genomes, locus_tags and KEGG pathways are stored in a database (in a cloud-based Azure Cosmos DB for MongoDB). The Microsoft Azure Blob Storage is still used as a data lake to store static unstructured or semi-structured data, e.g., plots, bibliome and phylogenetic trees (i.e., data that are not used by search or any other scripts generating dynamic content).</b>

## Contributors
Expand Down
37 changes: 34 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,45 @@ services:
networks:
- pankb-net

nginx:
container_name: pankb-nginx
nginx_dev:
profiles:
- dev
container_name: pankb-nginx-dev
build:
context: ./nginx
args:
- PANKB_SERVER_TYPE=dev
image: pankb_nginx_dev:latest
restart: always # for the container to be up and running again even after the VM is brought down
volumes:
- ./static:/static # a folder, where the static content will be served from
ports:
- 80:80
networks:
- pankb-net

nginx_prod:
profiles:
- prod
container_name: pankb-nginx-prod
build: ./nginx
image: pankb_nginx:latest
image: pankb_nginx_prod:latest
restart: always # for the container to be up and running again even after the VM is brought down
volumes:
- ./static:/static # a folder, where the static content will be served from
- ./certbot/www/:/var/www/certbot/:ro # a mounted folder that links nginx with certbot
- ./certbot/conf/live/pankb.org/fullchain.pem:/etc/nginx/ssl/live/pankb.org/fullchain.pem # the SSL certificate
- ./certbot/conf/live/pankb.org/privkey.pem:/etc/nginx/ssl/live/pankb.org/privkey.pem # the SSL private key
ports:
- 80:80
- 443:443
networks:
- pankb-net

certbot:
profiles:
- prod
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw
4 changes: 3 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM nginx:1.19.0-alpine
ARG PANKB_SERVER_TYPE=prod

COPY ./default.conf /etc/nginx/conf.d/default.conf
COPY ./default-$PANKB_SERVER_TYPE.conf /etc/nginx/conf.d/default.conf
RUN [ "$PANKB_SERVER_TYPE" == "prod" ] && mkdir -p /etc/nginx/ssl/live/pankb.org || echo "Not in production"
File renamed without changes.
43 changes: 43 additions & 0 deletions nginx/default-prod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
upstream django {
server django_gunicorn:8000;
}


server {
listen 80;
listen [::]:80;

server_name pankb.org www.pankb.org;
server_tokens off;

location /.well-known/acme-challenge/ {
root /var/www/certbot;
}

location /static/ {
alias /static/;
}

location / {
return 301 https://$server_name$request_uri;
}
}


server {
listen 443 default_server ssl http2;
listen [::]:443 ssl http2;

server_name pankb.org www.pankb.org;

ssl_certificate /etc/nginx/ssl/live/pankb.org/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/pankb.org/privkey.pem;

location /static/ {
alias /static/;
}

location / {
proxy_pass http://django;
}
}

0 comments on commit 1329b5e

Please sign in to comment.