-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from CorreiaEduardo/feature/dockerfile
Feature/dockerfile
- Loading branch information
Showing
18 changed files
with
427 additions
and
76 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 |
---|---|---|
|
@@ -2,4 +2,6 @@ blastdb/ | |
temp_genomes/ | ||
results/ | ||
.vscode/ | ||
tests/ | ||
tests/ | ||
__init__.py | ||
docs/ |
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,29 +1,58 @@ | ||
FROM ubuntu:20.04 | ||
|
||
FROM docker:24.0.2-dind as builder | ||
USER root | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
COPY . /app | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
# apt-transport-https \ | ||
# ca-certificates \ | ||
# build-essential \ | ||
curl \ | ||
# gnupg-agent \ | ||
# software-properties-common && \ | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ | ||
add-apt-repository \ | ||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) stable" && \ | ||
apt-get install -y docker-ce docker-ce-cli containerd.io && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | ||
sudo apt install python3.11 | ||
|
||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - &&\ | ||
poetry install --no-root | ||
|
||
RUN apk update && apk add --no-cache \ | ||
ca-certificates \ | ||
curl \ | ||
bash \ | ||
tzdata \ | ||
build-base \ | ||
python3 \ | ||
python3-dev \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
musl-dev \ | ||
gcc \ | ||
make \ | ||
docker-cli \ | ||
zlib \ | ||
bzip2 \ | ||
libgcc \ | ||
libstdc++ \ | ||
libgomp \ | ||
gcompat | ||
|
||
# RUN apk add --no-cache bash curl binutils \ | ||
# && curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ | ||
# && curl -Lo /glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \ | ||
# && curl -Lo /glibc-bin.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \ | ||
# && apk add --no-cache --force-overwrite /glibc.apk /glibc-bin.apk \ | ||
# && rm /glibc.apk /glibc-bin.apk | ||
|
||
# RUN curl -o ncbi-blast.tar.gz https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.16.0+-x64-linux.tar.gz && \ | ||
# tar -xzvf ncbi-blast.tar.gz && \ | ||
# rm ncbi-blast.tar.gz | ||
# ENV BLAST_PATH="/app/ncbi-blast-2.16.0+/bin" | ||
# ENV PATH="${BLAST_PATH}:${PATH}" | ||
|
||
RUN curl -o fam-substrate-mapping-08012023.tsv https://bcb.unl.edu/dbCAN2/download/Databases/fam-substrate-mapping-08012023.tsv && \ | ||
mv fam-substrate-mapping-08012023.tsv fam-substrate-mapping.tsv | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_CACHE_DIR='/var/cache/pypoetry' \ | ||
POETRY_HOME='/usr/local' \ | ||
POETRY_VERSION=1.5.1 | ||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
RUN poetry install --no-root | ||
RUN chmod +x /app/start.sh | ||
|
||
RUN dos2unix /app/start.sh | ||
RUN chmod +x /app/run_flask.sh | ||
RUN dos2unix /app/run_flask.sh | ||
ENV FLASK_APP=plasticome.routes.app.py | ||
FROM builder as runner | ||
CMD [ "/bin/bash", "/app/start.sh" ] | ||
|
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,121 @@ | ||
services: | ||
metadata: | ||
container_name: plasticome_metadata | ||
# build: | ||
# context: ./plasticome-metadata | ||
# dockerfile: Dockerfile | ||
image: correiaeduardo/plasticome-metadata:final-1 | ||
environment: | ||
- C_FORCE_ROOT=true | ||
- FLASK_RUN_HOST=metadata | ||
- JWT_SECRET_KEY=${JWT_SECRET_KEY} | ||
- DATABASE_NAME=${DATABASE_NAME} | ||
- DATABASE_USER=${DATABASE_USER} | ||
- DATABASE_PASSWORD=${DATABASE_PASSWORD} | ||
- DATABASE_PORT=${DATABASE_PORT} | ||
- DATABASE_HOST=${DATABASE_HOST} | ||
restart: always | ||
ports: | ||
- "5001:5000" | ||
volumes: | ||
- data:/metadata | ||
- ./plasticome-metadata:/app | ||
depends_on: | ||
- postgres | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
backend: | ||
container_name: plasticome_backend | ||
build: | ||
context: ./plasticome-backend | ||
dockerfile: Dockerfile | ||
privileged: true | ||
environment: | ||
- DOCKER_HOST=tcp://localhost:2375 | ||
- [email protected] | ||
- RABBIT_MQ_URL=amqp://guest:guest@plasticome_rabbitmq:5672// | ||
- CELERY_BROKER_URL=amqp://guest:guest@plasticome_rabbitmq:5672// | ||
- RESULT_BACKEND=redis://plasticome_redis:6379/0 | ||
- PLASTICOME_METADATA_URL=http://metadata:5000/ | ||
- C_FORCE_ROOT=true | ||
- FLASK_RUN_HOST=backend | ||
- PLASTICOME_USER=${PLASTICOME_USER} | ||
- PLASTICOME_PASSWORD=${PLASTICOME_PASSWORD} | ||
- MAIL_USER=${MAIL_USER} | ||
- MAIL_SERVER=${MAIL_SERVER} | ||
- MAIL_SECRET=${MAIL_SECRET} | ||
- MAIL_ACCESS_PORT=${MAIL_ACCESS_PORT} | ||
restart: always | ||
ports: | ||
- "5002:5000" | ||
depends_on: | ||
- rabbitmq | ||
- metadata | ||
volumes: | ||
- data:/backend | ||
- ./plasticome-backend/plasticome:/app/plasticome | ||
- ./temp_genomes:/app/temp_genomes | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
rabbitmq: | ||
container_name: plasticome_rabbitmq | ||
image: rabbitmq:management | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
environment: | ||
- RABBITMQ_DEFAULT_VHOST= | ||
- RABBITMQ_DEFAULT_USER=guest | ||
- RABBITMQ_DEFAULT_PASS=guest | ||
depends_on: | ||
- redis | ||
networks: | ||
- plasticome | ||
# - internal | ||
volumes: | ||
- rabbitmq_data:/data | ||
|
||
redis: | ||
container_name: plasticome_redis | ||
image: redis | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- plasticome | ||
# - internal | ||
volumes: | ||
- redis_data:/data | ||
|
||
postgres: | ||
container_name: plasticome_postgres | ||
image: postgres | ||
volumes: | ||
- ./pg_data:/var/lib/postgresql/data | ||
- ./plasticome-metadata/scripts:/scripts | ||
- ./plasticome-metadata/dump/plasticome-psql-v1.sql.lzo:/dump/plasticome-psql-v1.sql.lzo | ||
environment: | ||
POSTGRES_DB: ${DATABASE_NAME} | ||
POSTGRES_USER: ${DATABASE_USER} | ||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} | ||
ports: | ||
- "33805:5432" | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
networks: | ||
plasticome: | ||
driver: bridge | ||
# internal: | ||
# external: true | ||
volumes: | ||
data: | ||
rabbitmq_data: | ||
pg_data: | ||
redis_data: | ||
|
||
|
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,136 @@ | ||
services: | ||
metadata: | ||
container_name: plasticome_metadata | ||
# build: | ||
# context: ./plasticome-metadata | ||
# dockerfile: Dockerfile | ||
image: correiaeduardo/plasticome-metadata:final-1 | ||
environment: | ||
- C_FORCE_ROOT=true | ||
- FLASK_RUN_HOST=metadata | ||
- JWT_SECRET_KEY=${JWT_SECRET_KEY} | ||
- DATABASE_NAME=${DATABASE_NAME} | ||
- DATABASE_USER=${DATABASE_USER} | ||
- DATABASE_PASSWORD=${DATABASE_PASSWORD} | ||
- DATABASE_PORT=${DATABASE_PORT} | ||
- DATABASE_HOST=${DATABASE_HOST} | ||
restart: always | ||
ports: | ||
- "5001:5000" | ||
volumes: | ||
- data:/metadata | ||
- ./plasticome-metadata:/app | ||
depends_on: | ||
- postgres | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
backend: | ||
container_name: plasticome_backend | ||
build: | ||
context: ./plasticome-backend | ||
dockerfile: Dockerfile | ||
privileged: true | ||
environment: | ||
- DOCKER_HOST=tcp://localhost:2375 | ||
- [email protected] | ||
- RABBIT_MQ_URL=amqp://guest:guest@plasticome_rabbitmq:5672// | ||
- CELERY_BROKER_URL=amqp://guest:guest@plasticome_rabbitmq:5672// | ||
- RESULT_BACKEND=redis://plasticome_redis:6379/0 | ||
- PLASTICOME_METADATA_URL=http://metadata:5000/ | ||
- C_FORCE_ROOT=true | ||
- FLASK_RUN_HOST=backend | ||
- PLASTICOME_USER=${PLASTICOME_USER} | ||
- PLASTICOME_PASSWORD=${PLASTICOME_PASSWORD} | ||
- MAIL_USER=${MAIL_USER} | ||
- MAIL_SERVER=${MAIL_SERVER} | ||
- MAIL_SECRET=${MAIL_SECRET} | ||
- MAIL_ACCESS_PORT=${MAIL_ACCESS_PORT} | ||
restart: always | ||
ports: | ||
- "5002:5000" | ||
depends_on: | ||
- rabbitmq | ||
- metadata | ||
volumes: | ||
- data:/backend | ||
- ./plasticome-backend/plasticome:/app/plasticome | ||
- ./temp_genomes:/app/temp_genomes | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
frontend: | ||
container_name: plasticome_frontend | ||
build: | ||
context: ./plasticome-frontend | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ./plasticome-frontend:/usr/share/nginx/html | ||
depends_on: | ||
- backend | ||
ports: | ||
- "3000:80" | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
rabbitmq: | ||
container_name: plasticome_rabbitmq | ||
image: rabbitmq:management | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
environment: | ||
- RABBITMQ_DEFAULT_VHOST= | ||
- RABBITMQ_DEFAULT_USER=guest | ||
- RABBITMQ_DEFAULT_PASS=guest | ||
depends_on: | ||
- redis | ||
networks: | ||
- plasticome | ||
# - internal | ||
volumes: | ||
- rabbitmq_data:/data | ||
|
||
redis: | ||
container_name: plasticome_redis | ||
image: redis | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- plasticome | ||
# - internal | ||
volumes: | ||
- redis_data:/data | ||
|
||
postgres: | ||
container_name: plasticome_postgres | ||
image: postgres | ||
volumes: | ||
- ./pg_data:/var/lib/postgresql/data | ||
- ./plasticome-metadata/scripts:/scripts | ||
- ./plasticome-metadata/dump/plasticome-psql-v1.sql.lzo:/dump/plasticome-psql-v1.sql.lzo | ||
environment: | ||
POSTGRES_DB: ${DATABASE_NAME} | ||
POSTGRES_USER: ${DATABASE_USER} | ||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} | ||
ports: | ||
- "33805:5432" | ||
networks: | ||
- plasticome | ||
# - internal | ||
|
||
networks: | ||
plasticome: | ||
driver: bridge | ||
# internal: | ||
# external: true | ||
volumes: | ||
data: | ||
rabbitmq_data: | ||
pg_data: | ||
redis_data: | ||
|
||
|
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,3 @@ | ||
from .celery import celery_app | ||
|
||
__all__ = ("celery_app",) |
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
Oops, something went wrong.