Skip to content

Commit

Permalink
Feature/mongodb (#88)
Browse files Browse the repository at this point in the history
* feature: changed elastic push to mongodb push

* fix: added createdAt field

* style: changed interface to type

* fix: removed unused private start call, added types
  • Loading branch information
atassis authored Dec 3, 2020
1 parent 5d0a0ae commit 63800d5
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 113 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
##
# Connection variables
DATABASE_URL=postgres://rubot:rubot@postgres/rubot
ELASTICSEARCH_URL=http://elasticsearch:9200

##
# Authentication variables
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM node:fermium-alpine as base
WORKDIR /root/app
ENTRYPOINT [ "npm", "run" ]
COPY . .

RUN npm install && npm run build
COPY package.json package-lock.json ./
RUN npm install

COPY . .
RUN npm run build

FROM base AS release
COPY --from=base /root/app/dist ./dist
Expand Down
30 changes: 8 additions & 22 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ services:
- ./.env
environment:
- NODE_ENV=production
networks:
- default
- mongo_default
external_links:
- ${MONGO_CONTAINER_NAME}:mongodb
postgres:
image: postgres:9-alpine
restart: always
Expand All @@ -16,25 +21,6 @@ services:
- ./data/pgsql/data:/var/lib/postgresql/data
- ./data/pgsql/config:/etc/postgresql
- ./data/pgsql/logs:/var/log/postgresql/
admin:
image: sosedoff/pgweb
restart: always
ports:
- 10000:8081
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
restart: always
env_file:
- ./.env
environment:
- discovery.type=single-node
volumes:
- ./data/elastic:/usr/share/elasticsearch/data
kibana:
image: docker.elastic.co/kibana/kibana:7.10.0
env_file:
- ./.env
ports:
- 10001:5601
links:
- elasticsearch
networks:
mongo_default:
external: true
180 changes: 152 additions & 28 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
},
"license": "MIT",
"dependencies": {
"@elastic/elasticsearch": "^7.10.0",
"@sentry/node": "^5.28.0",
"dotenv": "^8.2.0",
"mongodb": "^3.6.3",
"pg": "^8.5.1",
"sequelize": "^6.3.5",
"sequelize-cli": "^6.2.0",
"telegraf": "^3.38.0",
"telegraf-throttler": "^0.2.0"
},
"devDependencies": {
"@types/validator": "^13.1.0",
"@types/mongodb": "^3.6.0",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"cz-customizable": "^6.3.0",
Expand Down
Loading

0 comments on commit 63800d5

Please sign in to comment.