Skip to content

Commit

Permalink
Add docker-compose from remote for local deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Jan 26, 2024
1 parent 0d63cc5 commit 99b80be
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
64 changes: 64 additions & 0 deletions config/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion config/fe/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"lbBaseURL": "http://localhost:3000/",
"oAuth2Endpoint": {
"authURL": "auth/thirdparty/keycloak",
"authURL": "auth/keycloak",
"displayText": "keycloak"
}
}
5 changes: 4 additions & 1 deletion config/seed_db/seed/Basesnippet.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"$oid": "64e898e65b05b2003e22c2e4"
},
"name": "test",
"location": "test"
"location": "test",
"_id": {
"$oid": "64e898e65b05b2003e22c2e5"
}
}
]

0 comments on commit 99b80be

Please sign in to comment.