From 99b80be0a59a7ca621fe71faa368398f9f0e797c Mon Sep 17 00:00:00 2001 From: minottic Date: Thu, 25 Jan 2024 21:45:30 +0100 Subject: [PATCH] Add docker-compose from remote for local deploy --- config/docker-compose.yaml | 64 ++++++++++++++++++++++++++++ config/fe/config.json | 2 +- config/seed_db/seed/Basesnippet.json | 5 ++- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 config/docker-compose.yaml diff --git a/config/docker-compose.yaml b/config/docker-compose.yaml new file mode 100644 index 00000000..d56e99b1 --- /dev/null +++ b/config/docker-compose.yaml @@ -0,0 +1,64 @@ +version: "3.9" +services: + mongodb: + image: mongo:4.2 + volumes: + - mongodb_data:/data/db + - ./mongo/rs-init.sh:/rs-init.sh:ro + command: [ "--replSet", "rs0", "--bind_ip_all" ] + healthcheck: + test: ./rs-init.sh + interval: 5s + profiles: + - be + + mongodb_seed: + image: mongo:4.2 + volumes: + - ./seed_db/seed:/seed + - ./seed_db/mongo_import.sh:/mnt/mongo_import.sh + command: + - "sh" + - "-c" + - "chmod u+x /mnt/mongo_import.sh && /mnt/mongo_import.sh" + user: "0:0" + depends_on: + - mongodb + environment: + - DATABASE=scilog + restart: on-failure + profiles: + - be + + backend: + image: ghcr.io/paulscherrerinstitute/scilog/be + depends_on: + mongodb: + condition: service_healthy + volumes: + # uncomment and edit the ./be/oidc.json to enable oidc + # - ./be/oidc.json:/home/node/app/oidc.json + - ./be/datasource.json:/home/node/app/datasource.json + - ./be/functionalAccounts.json:/home/node/app/functionalAccounts.json + environment: + JWT_SECRET: jwt_secret + CHROME_BIN: /usr/bin/chromium + CHROME_PATH: /usr/lib/chromium/ + profiles: + - be + ports: + - 3000:3000 + + frontend: + image: ghcr.io/paulscherrerinstitute/scilog/fe + # volumes: + # uncomment to enable the oidc form + # - ./fe/config.json:/frontend/src/assets/config.json + profiles: + - fe + ports: + - 80:80 + +volumes: + mongodb_data: + driver: local diff --git a/config/fe/config.json b/config/fe/config.json index 3b0949da..fa7455f3 100644 --- a/config/fe/config.json +++ b/config/fe/config.json @@ -1,7 +1,7 @@ { "lbBaseURL": "http://localhost:3000/", "oAuth2Endpoint": { - "authURL": "auth/thirdparty/keycloak", + "authURL": "auth/keycloak", "displayText": "keycloak" } } diff --git a/config/seed_db/seed/Basesnippet.json b/config/seed_db/seed/Basesnippet.json index a50a0a52..d16ded93 100644 --- a/config/seed_db/seed/Basesnippet.json +++ b/config/seed_db/seed/Basesnippet.json @@ -35,6 +35,9 @@ "$oid": "64e898e65b05b2003e22c2e4" }, "name": "test", - "location": "test" + "location": "test", + "_id": { + "$oid": "64e898e65b05b2003e22c2e5" + } } ]