forked from SMarioMan/craig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6348e59
commit b655ad2
Showing
12 changed files
with
152 additions
and
22 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
File renamed without changes.
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
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
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
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
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,58 @@ | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: 'Craig', | ||
cwd: '/app/apps/bot', | ||
script: 'dist/sharding/index.js', | ||
wait_ready: true, | ||
kill_timeout: 3000, | ||
env: { | ||
NODE_ENV: 'development' | ||
}, | ||
env_production: { | ||
NODE_ENV: 'production' | ||
} | ||
}, | ||
{ | ||
name: 'Craig Dashboard', | ||
cwd: '/app/apps/dashboard', | ||
script: 'npm', | ||
args: 'start', | ||
env: { | ||
NODE_ENV: 'development' | ||
}, | ||
env_production: { | ||
NODE_ENV: 'production' | ||
} | ||
}, | ||
{ | ||
name: 'craig.horse', | ||
cwd: '/app/apps/download', | ||
script: 'dist/index.js', | ||
instances: '8', | ||
exec_mode: 'cluster', | ||
wait_ready: true, | ||
listen_timeout: 10000, | ||
kill_timeout: 3000, | ||
env: { | ||
NODE_ENV: 'development' | ||
}, | ||
env_production: { | ||
NODE_ENV: 'production' | ||
} | ||
}, | ||
{ | ||
name: 'Craig Tasks', | ||
cwd: '/app/apps/tasks', | ||
script: 'dist/index.js', | ||
wait_ready: true, | ||
kill_timeout: 3000, | ||
env: { | ||
NODE_ENV: 'development' | ||
}, | ||
env_production: { | ||
NODE_ENV: 'production' | ||
} | ||
} | ||
] | ||
}; |
File renamed without changes.
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
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,45 @@ | ||
version: '3.1' | ||
services: | ||
db: | ||
image: postgres | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: demo | ||
POSTGRES_DB: craig | ||
POSTGRES_USER: craig | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U craig"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
redis: | ||
image: redis | ||
restart: always | ||
ports: | ||
- "6379:6379" | ||
craig: | ||
build: . | ||
ports: | ||
- "3000:3000" | ||
- "5029:5029" | ||
environment: | ||
REDIS_HOST: redis | ||
REDIS_PORT: "6379" | ||
DISCORD_BOT_TOKEN: "dummy" | ||
DISCORD_APP_ID: "dummy" | ||
CLIENT_ID: "dummy" | ||
CLIENT_SECRET: "dummy" | ||
DATABASE_URL: "postgresql://craig:demo@db:5432/craig?schema=public" | ||
API_HOMEPAGE: "http://localhost:5029" | ||
API_HOST: "0.0.0.0" | ||
ENNUIZEL_BASE: "https://ez.craig.horse/" | ||
NODE_ENV: 'development' | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
restart: true | ||
redis: | ||
condition: service_started | ||
# command: sleep infinity |
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
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,14 @@ | ||
#!/bin/bash | ||
set -x | ||
env | ||
yarn prisma:deploy | ||
yarn run sync | ||
|
||
DOWNLOAD_DOMAIN=$(echo $API_HOMEPAGE|awk -F'://' '{print $2}') | ||
sed -z -E -i'' "s/(dexare:.*token:\s*)('')(.*applicationID:\s*)('')(.*downloadDomain:\s*)('localhost:5029')/\ | ||
\1'${DISCORD_BOT_TOKEN}'\3'${DISCORD_APP_ID}'\5'${DOWNLOAD_DOMAIN//\//\\/}'/" \ | ||
"/app/apps/bot/config/default.js" | ||
|
||
pm2 start /app/apps/ecosystem.config.js | ||
pm2 save | ||
pm2 logs |