-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added docker file and necessary utils for production environment
- Loading branch information
Showing
7 changed files
with
106 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# compiled output | ||
/dist | ||
/node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
pnpm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
# misc | ||
/.silent-pay-indexer | ||
|
||
#e2e | ||
/e2e/.logs | ||
|
||
#dev | ||
/config/dev.config.yaml | ||
/config/e2e.config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ lerna-debug.log* | |
|
||
#e2e | ||
/e2e/.logs | ||
|
||
#dev | ||
/config/dev.config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Stage 1: Build the NestJS application | ||
FROM node:22-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json for efficient layer caching | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
# Stage 2: Production image | ||
FROM node:22-alpine AS production | ||
|
||
WORKDIR /app | ||
|
||
#Copy the compiled application from the build stage | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/migrations ./migrations | ||
|
||
#Copy package.json and install only production dependencies | ||
COPY package*.json ./ | ||
RUN npm install --omit=dev | ||
|
||
# Set environment variables for SQLite path and app port | ||
ENV DB_PATH="/app/data/database.sqlite" | ||
ENV APP_PORT="80" | ||
|
||
VOLUME /app/data | ||
|
||
EXPOSE $APP_PORT | ||
|
||
# Set up entrypoint to handle database migration and config generation | ||
ENTRYPOINT ["sh", "-c", "npm run migration:run && mv dist/config/example.config.yaml dist/config/config.yaml && node dist/main.js"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
db: | ||
path: '~/.silent-pay-indexer/db/database.sqlite' | ||
synchronize: false | ||
app: | ||
port: 3000 | ||
verbose: false | ||
debug: true | ||
network: regtest | ||
requestRetry: | ||
delay: 500 # delay in Milliseconds | ||
count: 3 | ||
providerType: BITCOIN_CORE_RPC | ||
bitcoinCore: | ||
protocol: http # http | https | ||
rpcHost: localhost | ||
rpcPass: password | ||
rpcUser: polaruser | ||
rpcPort: 18443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters