From fc3e802856d1209ee9e47e3f0a2a073c475bd7ae Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 13 Jul 2021 10:40:53 -0700 Subject: docker compose override for development ui container --- .gitignore | 1 + README.md | 1 + db/migrations/referrals.sql | 34 ---------------------------------- docker-compose.yml | 4 +--- routes/payments.js | 8 +++++--- sample.override.yml | 13 +++++++++++++ 6 files changed, 21 insertions(+), 40 deletions(-) delete mode 100644 db/migrations/referrals.sql create mode 100644 sample.override.yml diff --git a/.gitignore b/.gitignore index 58f3c4fe..2537982f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ lnurl-server.sqlite3 watcher.log config mysql +docker-compose.override.yml diff --git a/README.md b/README.md index 9d1ee35c..9ab192f8 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ This repository contains the code for the backend API server which is implemente cp fx.sample fx mkdir mysql cp db/schema.sql mysql/ + cp sample.override.yml docker-compose.override.yml docker-compose up -d --force-recreate maria docker exec -i mariadb mysql -u root -ppassword < mysql/schema.sql docker-compose up diff --git a/db/migrations/referrals.sql b/db/migrations/referrals.sql deleted file mode 100644 index da395d5f..00000000 --- a/db/migrations/referrals.sql +++ /dev/null @@ -1,34 +0,0 @@ --- Note: Adding FK contraints may cause issues, so I have commented them out for now, but these need to be established -DROP TABLE IF EXISTS `referrals`; -CREATE TABLE `referrals` ( - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `token` varchar(255) DEFAULT NULL UNIQUE, - `expiry` date DEFAULT NULL, - `status` enum('pending','active','expired','cancelled') DEFAULT NULL, - `sponsor_id` int(11) NOT NULL, - `user_id` int(11) DEFAULT NULL, - `created_at` timestamp DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp, - PRIMARY KEY (`id`), - KEY `sponsor_id` (`sponsor_id`), - KEY `user_id` (`user_id`) - -- FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), - -- FOREIGN KEY (`sponsor_id`) REFERENCES `users` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; - -DROP TABLE IF EXISTS `waiting_list`; -CREATE TABLE `waiting_list` ( - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `email` varchar(255) DEFAULT NULL UNIQUE, - `sms` varchar(255) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `status` enum('pending','contacted','registered','cancelled') DEFAULT 'pending', - `notes` text DEFAULT NULL, - `created_at` timestamp DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp, - PRIMARY KEY (`id`) - -- CONSTRAINT `user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; - -ALTER TABLE users ADD `email` varchar(255) DEFAULT NULL; -ALTER TABLE users ADD `sms` varchar(255) DEFAULT NULL; diff --git a/docker-compose.yml b/docker-compose.yml index 8cbc3aa1..76fa0f3d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,9 +8,7 @@ services: ports: - '8085:8085' environment: - NODE_ENV: development - volumes: - - ../coinos-ui:/coinos + NODE_ENV: production app: depends_on: - maria diff --git a/routes/payments.js b/routes/payments.js index a4bae562..960b0d39 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -56,6 +56,7 @@ ah(async () => { ).map((p) => p.hash); + /* setInterval(async () => { const unconfirmed = ( await db.Payment.findAll({ @@ -134,14 +135,15 @@ ah(async () => { } }, 50); } + */ if (config.liquid) { lq = new BitcoinCore(config.liquid); rare = new BitcoinCore(config.rare); app.post("/liquid/broadcast", optionalAuth, require("./liquid/broadcast")); - app.get("/liquid/generate", auth, require("./liquid/generate")); - app.post("/liquid/fee", auth, require("./liquid/fee")); - app.post("/liquid/send", auth, require("./liquid/send")); + // app.get("/liquid/generate", auth, require("./liquid/generate")); + // app.post("/liquid/fee", auth, require("./liquid/fee")); + // app.post("/liquid/send", auth, require("./liquid/send")); require("./liquid/receive"); setTimeout(async () => { diff --git a/sample.override.yml b/sample.override.yml new file mode 100644 index 00000000..cec5a60f --- /dev/null +++ b/sample.override.yml @@ -0,0 +1,13 @@ +version: '3.6' +services: + ui: + depends_on: + - app + container_name: ui + image: asoltys/coinos-ui + ports: + - '8085:8085' + environment: + NODE_ENV: development + volumes: + - ../coinos-ui:/coinos -- cgit v1.2.3