refine docker config

This commit is contained in:
keyan 2024-03-06 17:38:34 -06:00
parent a3428d1edc
commit 0614cfe979
3 changed files with 41 additions and 21 deletions

View File

@ -4,16 +4,16 @@
############################################################################ ############################################################################
# github # github
GITHUB_ID=<YOUR GITHUB ID> GITHUB_ID=
GITHUB_SECRET=<YOUR GITHUB SECRET> GITHUB_SECRET=
# twitter # twitter
TWITTER_ID=<YOUR TWITTER ID> TWITTER_ID=
TWITTER_SECRET=<YOUR TWITTER SECRET> TWITTER_SECRET=
# email # email
LOGIN_EMAIL_SERVER=smtp://<YOUR EMAIL>:<YOUR PASSWORD>@<YOUR SMTP DOMAIN>:587 LOGIN_EMAIL_SERVER=
LOGIN_EMAIL_FROM=<YOUR FROM ALIAS> LOGIN_EMAIL_FROM=
LIST_MONK_AUTH= LIST_MONK_AUTH=
##################################################################### #####################################################################
@ -48,16 +48,16 @@ OPENSEARCH_MODEL_ID=
####################################################### #######################################################
# lnd # lnd
LND_CERT=<YOUR LND HEX CERT> LND_CERT=
LND_MACAROON=<YOUR LND HEX MACAROON> LND_MACAROON=
LND_SOCKET=<YOUR LND GRPC HOST>:<YOUR LND GRPC PORT> LND_SOCKET=
# lnurl # lnurl
LNAUTH_URL=<PUBLIC URL TO /api/lnauth> LNAUTH_URL=
LNWITH_URL=<PUBLIC URL TO /api/lnwith> LNWITH_URL=
# nostr (NIP-57 zap receipts) # nostr (NIP-57 zap receipts)
NOSTR_PRIVATE_KEY=<YOUR NOSTR PRIVATE KEY IN HEX> NOSTR_PRIVATE_KEY=
############### ###############
# LEAVE AS IS # # LEAVE AS IS #

View File

@ -8,4 +8,6 @@ WORKDIR /app
EXPOSE 3000 EXPOSE 3000
CMD npm install --loglevel verbose --legacy-peer-deps; npx prisma migrate dev; npm run dev RUN npm install --loglevel verbose --legacy-peer-deps
RUN npx prisma migrate dev
CMD npm run dev

View File

@ -9,12 +9,19 @@ services:
ports: ports:
- "5431:5432" - "5431:5432"
env_file: env_file:
- ./.env.sample - ./.env.sndev
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes: volumes:
- ./anon.sql:/docker-entrypoint-initdb.d/anon.sql
- db:/var/lib/postgresql/data - db:/var/lib/postgresql/data
app: app:
container_name: app container_name: app
build: ./ build: ./
restart: always
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"] test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s interval: 10s
@ -22,9 +29,12 @@ services:
retries: 10 retries: 10
start_period: 1m30s start_period: 1m30s
depends_on: depends_on:
- db db:
condition: service_healthy
env_file: env_file:
- ./.env.sample - ./.env.sndev
expose:
- "3000"
ports: ports:
- "3000:3000" - "3000:3000"
volumes: volumes:
@ -35,13 +45,16 @@ services:
worker: worker:
container_name: worker container_name: worker
build: ./worker build: ./worker
restart: always
depends_on: depends_on:
db: db:
condition: service_started condition: service_healthy
app: app:
condition: service_healthy condition: service_healthy
opensearch:
condition: service_healthy
env_file: env_file:
- ./.env.sample - ./.env.sndev
ports: ports:
- "8080:8080" - "8080:8080"
volumes: volumes:
@ -52,7 +65,7 @@ services:
- opensearch - opensearch
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: command:
- npm run worker - npm run worker:dev
imgproxy: imgproxy:
container_name: imgproxy container_name: imgproxy
image: darthsim/imgproxy:v3.18.1 image: darthsim/imgproxy:v3.18.1
@ -63,7 +76,7 @@ services:
retries: 3 retries: 3
restart: always restart: always
env_file: env_file:
- ./.env.sample - ./.env.sndev
expose: expose:
- "8080" - "8080"
ports: ports:
@ -73,6 +86,12 @@ services:
opensearch: opensearch:
image: opensearchproject/opensearch:latest image: opensearchproject/opensearch:latest
container_name: opensearch container_name: opensearch
healthcheck:
test: ["CMD-SHELL", "curl -ku admin:admin --silent --fail localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 10s
retries: 10
restart: always
environment: environment:
- discovery.type=single-node - discovery.type=single-node
- plugins.security.disabled=true - plugins.security.disabled=true
@ -81,7 +100,6 @@ services:
- 9600:9600 # Performance Analyzer - 9600:9600 # Performance Analyzer
volumes: volumes:
- os:/usr/share/opensearch/data - os:/usr/share/opensearch/data
- ./:/app
command: > command: >
bash -c ' bash -c '
set -m set -m