Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
derevnjuk committed Aug 17, 2021
2 parents 6d244ba + 5314c18 commit b3f2b71
Show file tree
Hide file tree
Showing 15 changed files with 4,354 additions and 2,016 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:14

WORKDIR /home/node/bc

Expand Down
2 changes: 0 additions & 2 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ services:

proxy:
image: nginx:1.17.3-alpine

ports:
- 8090:80

volumes:
- ./nginx-config/local.conf:/etc/nginx/conf.d/default.conf
- ./public/build:/htdocs
Expand Down
56 changes: 44 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,21 @@ services:
POSTGRES_DB: bc
POSTGRES_USER: bc
POSTGRES_PASSWORD: bc
healthcheck:
interval: 10s
retries: 10
test:
[
'CMD',
'pg_isready',
'-U',
'${POSTGRES_USER}',
'-P',
'${POSTGRES_PASSWORD}',
]
timeout: 45s
volumes:
- ./pg.sql:/docker-entrypoint-initdb.d/pg.sql
- ./pg.sql:/docker-entrypoint-initdb.d/pg.sql

nodejs:
image: neuralegion/brokencrystals
Expand All @@ -21,8 +34,8 @@ services:
cpus: 3.5
logging:
options:
max-file: "5"
max-size: "10m"
max-file: '5'
max-size: '10m'
depends_on:
- db
- keycloak
Expand All @@ -31,10 +44,10 @@ services:
image: neuralegion/brokencrystals-client
restart: always
environment:
CERTBOT_EMAIL: "[email protected]"
CERTBOT_EMAIL: '[email protected]'
ports:
- "80:80"
- "443:443"
- '80:80'
- '443:443'
depends_on:
- nodejs
volumes:
Expand All @@ -46,28 +59,41 @@ services:
restart: always
logging:
options:
max-file: "5"
max-size: "10m"
max-file: '5'
max-size: '10m'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 300 --debug

keycloak-db:
image: "postgres:12.2-alpine"
image: 'postgres:12.2-alpine'
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
healthcheck:
interval: 10s
retries: 10
test:
[
'CMD',
'pg_isready',
'-U',
'${POSTGRES_USER}',
'-P',
'${POSTGRES_PASSWORD}',
]
timeout: 45s
restart: on-failure
stdin_open: true
tty: true
volumes:
- "./keycloak/db:/var/lib/postgresql/data/"
- './keycloak/db:/var/lib/postgresql/data/'

keycloak:
image: jboss/keycloak:latest
volumes:
- "./keycloak/imports/realm-export.json:/opt/jboss/keycloak/imports/realm-export.json"
- './keycloak/imports/realm-export.json:/opt/jboss/keycloak/imports/realm-export.json'
environment:
DB_VENDOR: POSTGRES
DB_ADDR: keycloak-db
Expand All @@ -79,7 +105,13 @@ services:
KEYCLOAK_PASSWORD: Pa55w0rd
KEYCLOAK_IMPORT: /opt/jboss/keycloak/imports/realm-export.json -Dkeycloak.profile.feature.upload_scripts=enabled
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/auth/realms/brokencrystals/health/check/database" ]
test:
[
'CMD',
'curl',
'-f',
'http://localhost:8080/auth/realms/brokencrystals/health/check/database',
]
timeout: 10s
interval: 30s
retries: 3
Expand Down
88 changes: 60 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "prettier --write \"{src,public,test}/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint \"{src,public,test}/**/*.ts\"",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand All @@ -23,7 +23,7 @@
"dependencies": {
"@mikro-orm/core": "^4.3.3",
"@mikro-orm/nestjs": "^4.2.0",
"@mikro-orm/postgresql": "^4.3.3",
"@mikro-orm/postgresql": "^4.5.7",
"@mikro-orm/sql-highlighter": "^1.0.1",
"@nestjs/common": "^7.6.7",
"@nestjs/config": "^0.6.2",
Expand All @@ -44,7 +44,7 @@
"jwt-simple": "^0.5.6",
"libxmljs": "^0.19.7",
"node-jwk": "^0.1.0",
"pg": "^8.5.1",
"pg": "^8.7.1",
"raw-body": "^2.4.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
Expand Down
4 changes: 2 additions & 2 deletions pg.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ create table "product" ("id" serial primary key, "created_at" timestamptz(0) not

set session_replication_role = 'origin';
--password is admin
INSERT INTO public."user" (created_at, updated_at, email, password, first_name, last_name, is_admin, photo) VALUES (now(), now(), 'admin', '$2b$10$BBJjmVNNdyEgv7pV/zQR9u/ssIuwZsdDJbowW/Dgp28uws3GmO0Ky', 'admin', 'admin', false, null);
INSERT INTO "user" (created_at, updated_at, email, password, first_name, last_name, is_admin, photo) VALUES (now(), now(), 'admin', '$2b$10$BBJjmVNNdyEgv7pV/zQR9u/ssIuwZsdDJbowW/Dgp28uws3GmO0Ky', 'admin', 'admin', false, null);

--insert default products into the table
INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('Healing', '/api/file?path=config/products/crystals/amethyst.jpg&type=image/jpg', 'Amethyst', 'a violet variety of quartz');
Expand All @@ -19,4 +19,4 @@ INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('
INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('Healing', '/api/file?path=config/products/crystals/amber.jpg&type=image/jpg', 'Amber', 'fossilized tree resin');
INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('Jewellery', '/api/file?path=config/products/crystals/emerald.jpg&type=image/jpg', 'Emerald', 'symbol of fertility and life');
INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('Jewellery', '/api/file?path=config/products/crystals/shattuckite.jpg&type=image/jpg', 'Shattuckite', 'mistery');
INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('Gemstones', '/api/file?path=config/products/crystals/bismuth.jpg&type=image/jpg', 'Bismuth', 'rainbow');
INSERT INTO "product" ("category", "photo_url", "name", "description") VALUES ('Gemstones', '/api/file?path=config/products/crystals/bismuth.jpg&type=image/jpg', 'Bismuth', 'rainbow');
2 changes: 1 addition & 1 deletion public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10 AS builder
FROM node:14 AS builder

WORKDIR /home/node/bc

Expand Down
Loading

0 comments on commit b3f2b71

Please sign in to comment.