From e90a2d465ae7461c7a0c664d9cb21fe4dc0340d6 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Fri, 26 Jan 2024 09:17:48 +0100 Subject: [PATCH] added docker-compose.host for dkfz --- docker-compose.host.yml | 48 +++++++++++++++++++++++++++++++++++++++++ plays/setup_client.yml | 8 ++++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 docker-compose.host.yml diff --git a/docker-compose.host.yml b/docker-compose.host.yml new file mode 100644 index 0000000..ca93c53 --- /dev/null +++ b/docker-compose.host.yml @@ -0,0 +1,48 @@ +version: '3.5' +services: + simplevm-client: + container_name: simplevm-client + image: quay.io/denbicloud/simplevm-client:${CLOUD_PORTAL_CLIENT_TAG} + expose: + - "9090" # Expose the service port + env_file: + - .env + volumes: + - ${client_PERSISTENT_PATH}/config.yml:/code/simple_vm_client/config.yml + - ${client_PERSISTENT_PATH}/server.pem:/code/simple_vm_client/keys/server.pem + - ${client_PERSISTENT_PATH}/server.pem:/code/simple_vm_client/keys/CA.pem + - ./logs/client:/code/simple_vm_client/log:rw + command: python3 VirtualMachineServer.py /code/simple_vm_client/config.yml + network_mode: host # Use the host network namespace + + simplevm_client_redis: + container_name: simplevm_client_redis + network_mode: host # Use the host network namespace + image: redis:7.2.4 + expose: + - "6379" + + + simplevm_client_filebeat: + container_name: simplevm_client_filebeat + image: docker.elastic.co/beats/filebeat:8.11.4 + env_file: + - .env + volumes: + - ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml + - ./logs:/usr/share/filebeat/log:ro + - ./filebeat/data:/usr/share/filebeat/data:rw + command: [sh, -c, "chmod go-w /usr/share/filebeat/filebeat.yml && filebeat run -e"] + networks: + - portal-production + +networks: + portal-production: + name: portal-production + driver: bridge + driver_opts: + com.docker.network.driver.mtu: 1440 + default: + driver: bridge + driver_opts: + com.docker.network.driver.mtu: 1440 diff --git a/plays/setup_client.yml b/plays/setup_client.yml index d255bb5..9d913ad 100644 --- a/plays/setup_client.yml +++ b/plays/setup_client.yml @@ -141,7 +141,13 @@ shell: docker compose -f {{ client.REPO_PATH }}/docker-compose.yml up -d become: yes - when: "'bibigrid' not in ansible_run_tags" + when: "'bibigrid' not in ansible_run_tags and 'host_network' not in ansible_run_tags" + + - name: Start client docker container in host network without bibigrid + shell: docker compose -f {{ client.REPO_PATH }}/docker-compose.host.yml up -d + become: yes + tags: [ 'never', 'host_network' ] + - name: Start docker container with bibigrid shell: docker compose -f {{ client.REPO_PATH }}/docker-compose.bibigrid.yml up -d