Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Lauri Võsandi | 0c6fbfd924 | |
Erki Aas | 939c84c6ab | |
Erki Aas | 37117678f0 | |
Lauri Võsandi | 2908a0bed0 | |
Lauri Võsandi | ec59a423bb | |
Lauri Võsandi | 56e2273ba2 | |
Lauri Võsandi | 5060e36d02 |
|
@ -5,9 +5,9 @@ name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: backend
|
- name: backend
|
||||||
image: plugins/docker
|
image: harbor.k-space.ee/k-space/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
repo: harbor.k-space.ee/${DRONE_REPO}
|
repo: ${DRONE_REPO}
|
||||||
registry: harbor.k-space.ee
|
registry: harbor.k-space.ee
|
||||||
context: backend/
|
context: backend/
|
||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
|
@ -16,9 +16,9 @@ steps:
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
- name: frontend
|
- name: frontend
|
||||||
image: plugins/docker
|
image: harbor.k-space.ee/k-space/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
repo: harbor.k-space.ee/${DRONE_REPO}-frontend
|
repo: ${DRONE_REPO}-frontend
|
||||||
registry: harbor.k-space.ee
|
registry: harbor.k-space.ee
|
||||||
context: frontend/
|
context: frontend/
|
||||||
dockerfile: frontend/Dockerfile
|
dockerfile: frontend/Dockerfile
|
||||||
|
|
|
@ -8,8 +8,12 @@ const mongoCollection = process.env.MONGO_COLLECTION || 'eventlog';
|
||||||
const mongoUri = process.env.MONGO_URI || 'mongodb://127.0.0.1:27017/default?replicaSet=rs0';
|
const mongoUri = process.env.MONGO_URI || 'mongodb://127.0.0.1:27017/default?replicaSet=rs0';
|
||||||
|
|
||||||
// Minio set-up variables
|
// Minio set-up variables
|
||||||
const minioURI = new URL(process.env.MINIO_URI || 'http://kspace-mugshot:2mSI6HdbJ8@127.0.0.1:9000/kspace-mugshot');
|
const minioAccessKey = process.env.MINIO_ACCESS_KEY || 'kspace-mugshot';
|
||||||
const minioBucket = minioURI.pathname.substring(1);
|
const minioSecretKey = process.env.MINIO_SECRET_KEY || '2mSI6HdbJ8';
|
||||||
|
const minioHostname = process.env.MINIO_HOSTNAME || '127.0.0.1';
|
||||||
|
const minioPort = process.env.MINIO_PORT || 9000;
|
||||||
|
const minioScheme = process.env.MINIO_SCHEME || 'http';
|
||||||
|
const minioBucket = process.env.MINIO_BUCKET || 'kspace-mugshot';
|
||||||
console.info("Using bucket:", minioBucket);
|
console.info("Using bucket:", minioBucket);
|
||||||
const historyNumber = parseInt(process.env.HISTORY_AMOUNT) || 10;
|
const historyNumber = parseInt(process.env.HISTORY_AMOUNT) || 10;
|
||||||
|
|
||||||
|
@ -34,15 +38,18 @@ async function run() {
|
||||||
|
|
||||||
changeStream = collection.watch(pipeline, options);
|
changeStream = collection.watch(pipeline, options);
|
||||||
console.log("Started watching changes in database");
|
console.log("Started watching changes in database");
|
||||||
|
console.log("Minio hostname:", minioHostname);
|
||||||
|
console.log("Minio port:", minioPort);
|
||||||
|
console.log("Minio protocol:", minioScheme);
|
||||||
|
|
||||||
// Triggers on GET at /event route
|
// Triggers on GET at /event route
|
||||||
app.get('/events', async function (request, response) {
|
app.get('/events', async function (request, response) {
|
||||||
let minioClient = new minio.Client({
|
let minioClient = new minio.Client({
|
||||||
endPoint: minioURI.hostname,
|
endPoint: minioHostname,
|
||||||
port: parseInt(minioURI.port) || (minioURI.protocol == 'https:' ? 443 : 80),
|
port: parseInt(minioPort),
|
||||||
useSSL: minioURI.protocol == 'https:',
|
useSSL: minioScheme == 'https',
|
||||||
accessKey: minioURI.username,
|
accessKey: minioAccessKey,
|
||||||
secretKey: minioURI.password
|
secretKey: minioSecretKey
|
||||||
});
|
});
|
||||||
|
|
||||||
async function wrapEvent(doc) {
|
async function wrapEvent(doc) {
|
||||||
|
|
|
@ -9,8 +9,8 @@ x-common: &common
|
||||||
ME_CONFIG_MONGODB_ENABLE_ADMIN: 'true'
|
ME_CONFIG_MONGODB_ENABLE_ADMIN: 'true'
|
||||||
ME_CONFIG_MONGODB_SERVER: '127.0.0.1'
|
ME_CONFIG_MONGODB_SERVER: '127.0.0.1'
|
||||||
ME_CONFIG_MONGODB_AUTH_DATABASE: admin
|
ME_CONFIG_MONGODB_AUTH_DATABASE: admin
|
||||||
MINIO_ACCESS_KEY: kspace-mugshot
|
MINIO_ROOT_USER: kspace-mugshot
|
||||||
MINIO_SECRET_KEY: 2mSI6HdbJ8
|
MINIO_ROOT_PASSWORD: 2mSI6HdbJ8
|
||||||
MINIO_DEFAULT_BUCKETS: kspace-mugshot:download
|
MINIO_DEFAULT_BUCKETS: kspace-mugshot:download
|
||||||
MINIO_URI: 'http://kspace-mugshot:2mSI6HdbJ8@127.0.0.1:9000/kspace-mugshot'
|
MINIO_URI: 'http://kspace-mugshot:2mSI6HdbJ8@127.0.0.1:9000/kspace-mugshot'
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
|
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
|
||||||
command: mongod --replSet rs0 --bind_ip 127.0.0.1
|
command: mongod --replSet rs0 --bind_ip 127.0.0.1
|
||||||
|
logging:
|
||||||
|
driver: none
|
||||||
|
|
||||||
node-server:
|
node-server:
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -35,7 +37,7 @@ services:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
environment: *common
|
environment: *common
|
||||||
|
|
||||||
nginx-react:
|
nginx-react:
|
||||||
restart: always
|
restart: always
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
|
Loading…
Reference in New Issue