mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 20:14:15 +00:00
fix prod build
This commit is contained in:
parent
95465777a7
commit
7351322981
@ -1,8 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "comty.js",
|
"name": "comty.js",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"author": "RageStudio <support@ragestudio.net>",
|
"author": "RageStudio <support@ragestudio.net>",
|
||||||
|
"scripts": {
|
||||||
|
"build": "corenode-cli build"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@foxify/events": "^2.1.0",
|
"@foxify/events": "^2.1.0",
|
||||||
@ -11,5 +17,8 @@
|
|||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"linebridge": "^0.15.12"
|
"linebridge": "^0.15.12"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"corenode": "^0.28.26"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,21 @@ RUN apt install --no-install-recommends curl python yarn build-essential -y
|
|||||||
|
|
||||||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
||||||
|
|
||||||
|
# Copy comty.js to node_modules
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
EXPOSE 3010
|
EXPOSE 3040
|
||||||
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
COPY --chown=node:node . .
|
COPY --chown=node:node . .
|
||||||
|
|
||||||
RUN chmod -R 777 /home/node/app
|
RUN chmod -R 777 /home/node/app
|
||||||
RUN yarn install
|
|
||||||
|
RUN export NODE_ENV=production
|
||||||
|
|
||||||
|
RUN yarn global add cross-env
|
||||||
|
RUN yarn install --production
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
CMD ["node", "/home/node/app/dist/index.js"]
|
CMD ["yarn", "run", "run:prod"]
|
@ -4,7 +4,8 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "corenode-cli build",
|
"build": "corenode-cli build",
|
||||||
"dev": "cross-env NODE_ENV=development nodemon --ignore dist/ --exec corenode-node ./src/index.js"
|
"dev": "cross-env NODE_ENV=development nodemon --ignore dist/ --exec corenode-node ./src/index.js",
|
||||||
|
"run:prod": "cross-env NODE_ENV=production node ./dist/index.js"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -15,6 +16,7 @@
|
|||||||
"axios": "^1.2.5",
|
"axios": "^1.2.5",
|
||||||
"bcrypt": "^5.1.0",
|
"bcrypt": "^5.1.0",
|
||||||
"busboy": "^1.6.0",
|
"busboy": "^1.6.0",
|
||||||
|
"comty.js": "^0.1.1",
|
||||||
"connect-mongo": "^4.6.0",
|
"connect-mongo": "^4.6.0",
|
||||||
"content-range": "^2.0.2",
|
"content-range": "^2.0.2",
|
||||||
"corenode": "0.28.26",
|
"corenode": "0.28.26",
|
||||||
|
@ -1,12 +1,19 @@
|
|||||||
require("dotenv").config()
|
require("dotenv").config()
|
||||||
|
global.isProduction = process.env.NODE_ENV === "production"
|
||||||
|
|
||||||
import { webcrypto as crypto } from "crypto"
|
import { webcrypto as crypto } from "crypto"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { registerBaseAliases } from "linebridge/dist/server"
|
import { registerBaseAliases } from "linebridge/dist/server"
|
||||||
|
|
||||||
registerBaseAliases(undefined, {
|
const customAliases = {
|
||||||
"@services": path.resolve(__dirname, "services"),
|
"@services": path.resolve(__dirname, "services"),
|
||||||
"comty.js": path.resolve(__dirname, "../../comty.js/src"),
|
}
|
||||||
})
|
|
||||||
|
if (!global.isProduction) {
|
||||||
|
customAliases["comty.js"] = path.resolve(__dirname, "../../comty.js/src")
|
||||||
|
}
|
||||||
|
|
||||||
|
registerBaseAliases(undefined, customAliases)
|
||||||
|
|
||||||
// patches
|
// patches
|
||||||
const { Buffer } = require("buffer")
|
const { Buffer } = require("buffer")
|
||||||
@ -42,8 +49,6 @@ global.toBoolean = (value) => {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
global.isProduction = process.env.NODE_ENV === "production"
|
|
||||||
|
|
||||||
import API from "./api"
|
import API from "./api"
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
FROM node:16-bullseye
|
FROM node:16-bullseye-slim
|
||||||
|
|
||||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install --no-install-recommends curl python yarn -y
|
RUN apt install --no-install-recommends curl python yarn build-essential -y
|
||||||
|
|
||||||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
||||||
|
|
||||||
@ -16,8 +16,12 @@ COPY package.json ./
|
|||||||
COPY --chown=node:node . .
|
COPY --chown=node:node . .
|
||||||
|
|
||||||
RUN chmod -R 777 /home/node/app
|
RUN chmod -R 777 /home/node/app
|
||||||
RUN yarn install
|
|
||||||
|
RUN export NODE_ENV=production
|
||||||
|
|
||||||
|
RUN yarn global add cross-env
|
||||||
|
RUN yarn install --production
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
|
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
|
||||||
|
|
||||||
CMD ["node", "/home/node/app/dist/index.js"]
|
CMD ["yarn", "run", "run:prod"]
|
@ -4,7 +4,8 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "corenode-cli build",
|
"build": "corenode-cli build",
|
||||||
"dev": "cross-env NODE_ENV=development nodemon --ignore dist/ --exec corenode-node ./src/index.js"
|
"dev": "cross-env NODE_ENV=development nodemon --ignore dist/ --exec corenode-node ./src/index.js",
|
||||||
|
"run:prod": "cross-env NODE_ENV=production node ./dist/index.js"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -35,6 +36,7 @@
|
|||||||
"mongoose": "^6.9.0",
|
"mongoose": "^6.9.0",
|
||||||
"music-metadata": "^8.1.3",
|
"music-metadata": "^8.1.3",
|
||||||
"normalize-url": "^8.0.0",
|
"normalize-url": "^8.0.0",
|
||||||
|
"comty.js": "^0.1.1",
|
||||||
"nsfwjs": "2.4.2",
|
"nsfwjs": "2.4.2",
|
||||||
"p-map": "^6.0.0",
|
"p-map": "^6.0.0",
|
||||||
"p-queue": "^7.3.4",
|
"p-queue": "^7.3.4",
|
||||||
|
@ -1,11 +1,19 @@
|
|||||||
require("dotenv").config()
|
require("dotenv").config()
|
||||||
|
global.isProduction = process.env.NODE_ENV === "production"
|
||||||
|
|
||||||
import { webcrypto as crypto } from "crypto"
|
import { webcrypto as crypto } from "crypto"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { registerBaseAliases } from "linebridge/dist/server"
|
import { registerBaseAliases } from "linebridge/dist/server"
|
||||||
|
|
||||||
registerBaseAliases(undefined, {
|
const customAliases = {
|
||||||
"@services": path.resolve(__dirname, "services"),
|
"@services": path.resolve(__dirname, "services"),
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if (!global.isProduction) {
|
||||||
|
customAliases["comty.js"] = path.resolve(__dirname, "../../comty.js/src")
|
||||||
|
}
|
||||||
|
|
||||||
|
registerBaseAliases(undefined, customAliases)
|
||||||
|
|
||||||
// patches
|
// patches
|
||||||
const { Buffer } = require("buffer")
|
const { Buffer } = require("buffer")
|
||||||
@ -41,8 +49,6 @@ global.toBoolean = (value) => {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
global.isProduction = process.env.NODE_ENV === "production"
|
|
||||||
|
|
||||||
import API from "./api"
|
import API from "./api"
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user