-
-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Uzurka <101745008+Uzurka@users.noreply.github.com>
- Loading branch information
1 parent
6f97e4a
commit e6bce8b
Showing
4 changed files
with
66 additions
and
1 deletion.
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 |
---|---|---|
@@ -1 +1,19 @@ | ||
node_modules | ||
# only db, scripts, src, and user directories are needed | ||
.github | ||
.husky | ||
.vscode | ||
logs | ||
node_modules | ||
# prisma will generated by postinstall script | ||
prisma | ||
.all-contributorsrc | ||
.commitlintrc.js | ||
.dockerignore | ||
.env | ||
.eslintrc.json | ||
.gitattributes | ||
.gitignore | ||
CONTRIBUTORS.md | ||
Dockerfile | ||
jsconfig.json | ||
README.md |
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,32 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:18-alpine | ||
|
||
ENV NODE_ENV=production \ | ||
HTTP_HOST=0.0.0.0 \ | ||
HTTP_PORT=80 \ | ||
SETTINGS_HOST=127.0.0.1 \ | ||
SETTINGS_PORT=8169 | ||
|
||
WORKDIR /usr/bot | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
COPY --link scripts scripts | ||
|
||
# install python etc so node-gyp works for the optional dependencies | ||
RUN apk add --no-cache --virtual .build-deps make gcc g++ python3 \ | ||
# install pnpm to make dependency installation faster (because it has a lockfile) | ||
&& npm install -g pnpm \ | ||
# install dependencies, CI=true to skip pre/postinstall scripts | ||
&& CI=true pnpm install --prod --frozen-lockfile \ | ||
# pnpm isn't needed now | ||
&& npm uninstall pnpm --global \ | ||
# remove node-gyp stuff | ||
&& apk del .build-deps | ||
|
||
COPY --link . . | ||
|
||
EXPOSE ${HTTP_PORT} | ||
|
||
ENTRYPOINT [ "/bin/sh", "/usr/bot/scripts/start.sh" ] |
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,10 @@ | ||
#!/bin/sh | ||
|
||
echo "Checking environment..." | ||
node scripts/preinstall | ||
|
||
echo "Preparing the database..." | ||
node scripts/postinstall | ||
|
||
echo "Starting..." | ||
node src/ |