Skip to content

Commit

Permalink
begin nocapd container, fix logger pkg, other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Jan 23, 2024
1 parent 76d761a commit 8204684
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ yarn.lock
*.wasm
**/dist
yarn-error.log
.env
.env*
!*.sample
.lmdb
.redis
Expand Down
3 changes: 2 additions & 1 deletion apps/nocapd/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
config.y*ml
yarn.lock
.events
.events
.env*
21 changes: 21 additions & 0 deletions apps/nocapd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use an official Node.js runtime as a parent image, based on Alpine
FROM node:20-alpine

RUN mkdir /app

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /usr/src/app
COPY . .

# RUN echo "registry=http://host.docker.internal:4873" > .npmrc

# Install any needed packages specified in package.json
RUN yarn install --network-timeout 1000000

# Make port 3000 available to the world outside this container
# EXPOSE 3000

# Run the app when the container launches
CMD yarn launch
63 changes: 42 additions & 21 deletions apps/nocapd/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
version: "3"
services:
# nocapd:
# container_name: trawler
# restart: unless-stopped
# build: .
# volumes:
# - ./nocapd.config.yaml:/etc/@nostrwatch/nocapd/config.yaml
# - ./.lmdb:/app/.lmdb
# environment:
# DOCKER: 'yes'
# env_file: .env
cache:
image: redis:latest
restart: always
ports:
- '6379:6379'
volumes:
- ./.redis:/.data:rw
env_file: .env
command: redis-server --loglevel $REDIS_LOGLEVEL
nocapd:
container_name: nocapd
restart: unless-stopped
build:
context: .
args:
BUILDKIT_INLINE_CACHE: 0
dockerfile: Dockerfile
volumes:
- /Users/sandwich/Develop/nostr-watch/.lmdb:/app/.lmdb:rw
- ./.env.docker:/app/.env:ro
- ./config.yaml:/app/config.yaml:ro
environment:
DOCKER: 'yes'
env_file: .env.docker
# depends_on:
# - cache
networks:
- trawlernet
# cache:
# image: redis:latest
# restart: always
# ports:
# - '6379:6379'
# volumes:
# - ./.redis:/.data:rw
# env_file: .env.docker
# command: redis-server
# healthcheck:
# test: ["CMD", "redis-cli", "ping"]
# interval: 10s
# timeout: 5s
# retries: 3
# networks:
# - nocapdnet

volumes:
lmdb:
driver: local
cache:
driver: local
cache:
driver: local

networks:
trawlernet:
driver: bridge
10 changes: 9 additions & 1 deletion apps/nocapd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
"license": "MIT",
"dependencies": {
"@nostr-fetch/adapter-nostr-tools": "0.14.1",
"@nostrwatch/controlflow": "^0.0.2",
"@nostrwatch/logger": "^0.0.2",
"@nostrwatch/nocap": "^0.1.7",
"@nostrwatch/nwcache": "^0.0.1",
"@nostrwatch/publisher": "^0.0.1",
"@nostrwatch/seed": "^0.0.1",
"@nostrwatch/utils": "^0.0.1",
"chalk": "5.3.0",
"nostr-fetch": "0.14.1",
"object-mapper": "6.2.0"
"object-mapper": "6.2.0",
"timestring": "^7.0.0"
},
"scripts": {
"launch": "node src/index.js"
Expand Down
2 changes: 1 addition & 1 deletion apps/trawler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@nostr-fetch/adapter-nostr-tools": "0.13.1",
"@nostrwatch/controlflow": "^0.0.2",
"@nostrwatch/logger": "^0.0.1",
"@nostrwatch/nocap": "^0.1.5",
"@nostrwatch/nocap": "^0.1.7",
"@nostrwatch/nwcache": "^0.0.1",
"@nostrwatch/publisher": "^0.0.1",
"@nostrwatch/seed": "^0.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@nostrwatch/logger",
"version": "0.0.2",
"version": "0.0.3",
"type": "module",
"main": "index.js",
"license": "MIT",
"dependencies": {
"logger": "0.0.1"
"logging": "^3.3.0"
}
}
}

0 comments on commit 8204684

Please sign in to comment.