mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-22 16:55:30 +01:00
Switch back to NPM, optimize Dockerfile
This commit is contained in:
parent
f941dbbddd
commit
a51c712da8
|
@ -2,5 +2,5 @@ node_modules
|
|||
data
|
||||
dist
|
||||
dts
|
||||
yarn-error.log
|
||||
.env
|
||||
Dockerfile
|
||||
|
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -3,14 +3,6 @@ data
|
|||
dist
|
||||
dts
|
||||
|
||||
# Yarn
|
||||
.yarn/*
|
||||
!.yarn/releases
|
||||
!.yarn/plugins
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
.pnp.*
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
|
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"arcanis.vscode-zipfs",
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"search.exclude": {
|
||||
"**/.yarn": true,
|
||||
"**/.pnp.*": true
|
||||
},
|
||||
"eslint.nodePath": ".yarn/sdks",
|
||||
"typescript.tsdk": ".yarn/sdks/typescript/lib",
|
||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||
}
|
55
.yarn/releases/yarn-berry.js
vendored
55
.yarn/releases/yarn-berry.js
vendored
File diff suppressed because one or more lines are too long
20
.yarn/sdks/eslint/bin/eslint.js
vendored
20
.yarn/sdks/eslint/bin/eslint.js
vendored
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require eslint/bin/eslint.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real eslint/bin/eslint.js your application uses
|
||||
module.exports = absRequire(`eslint/bin/eslint.js`);
|
20
.yarn/sdks/eslint/lib/api.js
vendored
20
.yarn/sdks/eslint/lib/api.js
vendored
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require eslint/lib/api.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real eslint/lib/api.js your application uses
|
||||
module.exports = absRequire(`eslint/lib/api.js`);
|
6
.yarn/sdks/eslint/package.json
vendored
6
.yarn/sdks/eslint/package.json
vendored
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "eslint",
|
||||
"version": "7.12.0-pnpify",
|
||||
"main": "./lib/api.js",
|
||||
"type": "commonjs"
|
||||
}
|
5
.yarn/sdks/integrations.yml
vendored
5
.yarn/sdks/integrations.yml
vendored
|
@ -1,5 +0,0 @@
|
|||
# This file is automatically generated by PnPify.
|
||||
# Manual changes will be lost!
|
||||
|
||||
integrations:
|
||||
- vscode
|
20
.yarn/sdks/typescript/bin/tsc
vendored
20
.yarn/sdks/typescript/bin/tsc
vendored
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/bin/tsc
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/bin/tsc your application uses
|
||||
module.exports = absRequire(`typescript/bin/tsc`);
|
20
.yarn/sdks/typescript/bin/tsserver
vendored
20
.yarn/sdks/typescript/bin/tsserver
vendored
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/bin/tsserver
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/bin/tsserver your application uses
|
||||
module.exports = absRequire(`typescript/bin/tsserver`);
|
20
.yarn/sdks/typescript/lib/tsc.js
vendored
20
.yarn/sdks/typescript/lib/tsc.js
vendored
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/lib/tsc.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/lib/tsc.js your application uses
|
||||
module.exports = absRequire(`typescript/lib/tsc.js`);
|
77
.yarn/sdks/typescript/lib/tsserver.js
vendored
77
.yarn/sdks/typescript/lib/tsserver.js
vendored
|
@ -1,77 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
const moduleWrapper = tsserver => {
|
||||
// VSCode sends the zip paths to TS using the "zip://" prefix, that TS
|
||||
// doesn't understand. This layer makes sure to remove the protocol
|
||||
// before forwarding it to TS, and to add it back on all returned paths.
|
||||
|
||||
const {isAbsolute} = require(`path`);
|
||||
|
||||
const Session = tsserver.server.Session;
|
||||
const {onMessage: originalOnMessage, send: originalSend} = Session.prototype;
|
||||
let isVSCode = false;
|
||||
|
||||
return Object.assign(Session.prototype, {
|
||||
onMessage(/** @type {string} */ message) {
|
||||
const parsedMessage = JSON.parse(message)
|
||||
|
||||
if (
|
||||
parsedMessage != null &&
|
||||
typeof parsedMessage === 'object' &&
|
||||
parsedMessage.arguments &&
|
||||
parsedMessage.arguments.hostInfo === 'vscode'
|
||||
) {
|
||||
isVSCode = true;
|
||||
}
|
||||
|
||||
return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => {
|
||||
return typeof value === 'string' ? removeZipPrefix(value) : value;
|
||||
}));
|
||||
},
|
||||
|
||||
send(/** @type {any} */ msg) {
|
||||
return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => {
|
||||
return typeof value === 'string' ? addZipPrefix(value) : value;
|
||||
})));
|
||||
}
|
||||
});
|
||||
|
||||
function addZipPrefix(str) {
|
||||
// We add the `zip:` prefix to both `.zip/` paths and virtual paths
|
||||
if (isAbsolute(str) && !str.match(/^\^zip:/) && (str.match(/\.zip\//) || str.match(/\$\$virtual\//))) {
|
||||
// Absolute VSCode `Uri.fsPath`s need to start with a slash.
|
||||
// VSCode only adds it automatically for supported schemes,
|
||||
// so we have to do it manually for the `zip` scheme.
|
||||
// The path needs to start with a caret otherwise VSCode doesn't handle the protocol
|
||||
// https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
|
||||
return `${isVSCode ? '^' : ''}zip:${str.replace(/^\/?/, `/`)}`;
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
function removeZipPrefix(str) {
|
||||
return process.platform === 'win32'
|
||||
? str.replace(/^\^?zip:\//, ``)
|
||||
: str.replace(/^\^?zip:/, ``);
|
||||
}
|
||||
};
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/lib/tsserver.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/lib/tsserver.js your application uses
|
||||
module.exports = moduleWrapper(absRequire(`typescript/lib/tsserver.js`));
|
20
.yarn/sdks/typescript/lib/typescript.js
vendored
20
.yarn/sdks/typescript/lib/typescript.js
vendored
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.js";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require typescript/lib/typescript.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real typescript/lib/typescript.js your application uses
|
||||
module.exports = absRequire(`typescript/lib/typescript.js`);
|
6
.yarn/sdks/typescript/package.json
vendored
6
.yarn/sdks/typescript/package.json
vendored
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "typescript",
|
||||
"version": "4.0.3-pnpify",
|
||||
"main": "./lib/typescript.js",
|
||||
"type": "commonjs"
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
yarnPath: ".yarn/releases/yarn-berry.js"
|
30
Dockerfile
30
Dockerfile
|
@ -1,19 +1,33 @@
|
|||
FROM jrottenberg/ffmpeg:4.0-scratch
|
||||
FROM node:13
|
||||
FROM node:14-alpine AS base
|
||||
|
||||
# Copy ffmpeg bins
|
||||
COPY --from=0 / /
|
||||
# Install ffmpeg
|
||||
RUN apk add --no-cache ffmpeg
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY package.json .
|
||||
COPY package* ./
|
||||
|
||||
RUN yarn install
|
||||
# Dependencies
|
||||
FROM base AS dependencies
|
||||
|
||||
RUN npm install
|
||||
|
||||
# Build app
|
||||
FROM dependencies AS builder
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN yarn run build
|
||||
RUN npm run build
|
||||
|
||||
RUN ls
|
||||
|
||||
# Only copy essentials
|
||||
FROM base AS prod
|
||||
RUN ls
|
||||
COPY --from=builder /usr/app/dist dist
|
||||
|
||||
RUN npm i --only=prod
|
||||
|
||||
ENV DATA_DIR /data
|
||||
|
||||
CMD ["yarn", "start"]
|
||||
CMD ["npm", "run", "start"]
|
||||
|
|
4017
package-lock.json
generated
Normal file
4017
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -16,10 +16,10 @@
|
|||
"lint": "eslint 'src/**/*.ts'",
|
||||
"lint-fix": "eslint 'src/**/*.ts' --fix",
|
||||
"clean": "rm -rf dist dts",
|
||||
"test": "yarn lint",
|
||||
"test": "npm run lint",
|
||||
"build": "tsc",
|
||||
"watch": "tsc --watch",
|
||||
"prepack": "yarn clean && yarn build",
|
||||
"prepack": "npm run clean && npm run build",
|
||||
"start": "node dist/index.js",
|
||||
"dev": "nodemon",
|
||||
"docker-publish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t codetheweb/muse:latest --push ."
|
||||
|
@ -42,6 +42,7 @@
|
|||
"husky": "^4.3.0",
|
||||
"nodemon": "^2.0.6",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"sqlite3": "^5.0.0",
|
||||
"ts-node": "^9.0.0",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
|
@ -88,7 +89,6 @@
|
|||
"sequelize-typescript": "^1.1.0",
|
||||
"spotify-uri": "^2.1.0",
|
||||
"spotify-web-api-node": "^5.0.0",
|
||||
"sqlite3": "^5.0.0",
|
||||
"unique-random-array": "^2.0.0",
|
||||
"youtube.ts": "^0.1.8",
|
||||
"ytdl-core": "^3.4.2"
|
||||
|
|
Loading…
Reference in a new issue