From b0e55a108ab7c8b5c32b8d94f0b2616643a7919a Mon Sep 17 00:00:00 2001 From: AleixMT Date: Thu, 29 Feb 2024 19:10:48 +0100 Subject: [PATCH] ADDED: docker compose file --- .github/workflows/deploy.yml | 31 ++++++++++ .gitignore | 5 +- docker-compose.yml | 110 +++++++++++++++++++++++++++++++++++ 3 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 docker-compose.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f9aa8b4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: deploy + +# Trigger event on every push / delete event, no matter the branch +# on: [push, delete] + +# Trigger event on every push / delete event, only in master branch +on: + push: + branches: + - "master" + delete: + branches: + - "master" + +jobs: + deploy: + needs: build + runs-on: [self-hosted] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Stop eChempad container + run: docker-compose down + + - name: Force pulling of the images or they would not be updated + run: docker-compose pull + + - name: restart eChempad container with new image, which will be automatically pulled + run: docker-compose up -d \ No newline at end of file diff --git a/.gitignore b/.gitignore index bf72a16..a918586 100644 --- a/.gitignore +++ b/.gitignore @@ -52,8 +52,7 @@ Mkfile.old dkms.conf # own gitignore rules - -# ingore docker-compose files donwloaded -docker-compose.yml* shared index.html* +.idea +.idea/ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a826ec6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,110 @@ +# Obtained from https://raw.githubusercontent.com/ptrxyz/chemotion/latest-release/docker-compose.yml + +version: '3.9' +services: + db: + image: postgres:13 + restart: unless-stopped + hostname: db + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + volumes: + - chemotion_db:/var/lib/postgresql/data/ + networks: + - chemotion + + # This module contains Wine to make .exe files work in Linux. + # Antivirus may complain, so it is left commented out + # More about it in this issue: https://github.com/ComPlat/chemotion_ELN/issues/1331 + #msconvert: + #image: ptrxyz/chemotion:msconvert-1.6.0 + #restart: unless-stopped + #hostname: msconvert + #volumes: + #- spectra:/shared:rw + #networks: + #- chemotion + + spectra: + image: ptrxyz/chemotion:spectra-1.6.0 + restart: unless-stopped + hostname: spectra + volumes: + - spectra:/shared:rw + depends_on: + - msconvert + networks: + - chemotion + command: ["gunicorn", "--timeout", "600", "-w", "4", "-b", "0.0.0.0:4000", "server:app"] + + worker: + image: ptrxyz/chemotion:eln-1.6.0 + restart: unless-stopped + environment: + - CONFIG_ROLE=worker + - SECRET_KEY_BASE=pleasechangeme + depends_on: + - db + - eln + - spectra + volumes: + - chemotion_data:/chemotion/data/ + - chemotion:/chemotion/app + networks: + - chemotion + + eln: + image: ptrxyz/chemotion:eln-1.6.0 + restart: unless-stopped + environment: + - CONFIG_ROLE=eln + - SECRET_KEY_BASE=pleasechangeme + depends_on: + - db + - spectra + volumes: + - ./shared/pullin:/shared + - ./shared/backup:/backup + - chemotion_data:/chemotion/data/ + - chemotion:/chemotion/app + ports: + - 4000:4000 + networks: + - chemotion + + ketchersvc: + image: ptrxyz/chemotion:ketchersvc-1.6.0 + restart: unless-stopped + environment: + - CONFIG_KETCHER_URL=http://eln:4000/ketcher/ + init: true + depends_on: + eln: + condition: service_healthy + networks: + - chemotion + + converter: + image: ptrxyz/chemotion:converter-1.6.0 + restart: unless-stopped + environment: + - SECRET_KEY=imsupersecretandwanttobechanged + volumes: + - ./services/converter/profiles:/srv/chemotion/profiles + - ./services/converter/datasets:/srv/chemotion/datasets + networks: + - chemotion + +volumes: + chemotion: + name: chemotion_app + chemotion_data: + name: chemotion_data + chemotion_db: + name: chemotion_db + spectra: + name: chemotion_spectra + +networks: + chemotion: \ No newline at end of file