reorg: separate frontend and backend
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -4,18 +4,18 @@ FROM --platform=$TARGETPLATFORM node:20-slim AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files
|
# Copy package files
|
||||||
COPY package*.json ./
|
COPY backend/package*.json ./backend/
|
||||||
COPY frontend/package*.json ./frontend/
|
COPY frontend/package*.json ./frontend/
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm ci
|
RUN cd backend && npm ci
|
||||||
RUN cd frontend && npm ci
|
RUN cd frontend && npm ci
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build frontend and backend
|
# Build frontend and backend
|
||||||
RUN npm run build
|
RUN npm run build --workspaces
|
||||||
|
|
||||||
# Production stage
|
# Production stage
|
||||||
FROM --platform=$TARGETPLATFORM debian:testing-20250203
|
FROM --platform=$TARGETPLATFORM debian:testing-20250203
|
||||||
@@ -27,11 +27,11 @@ RUN apt-get update && apt-get install -y \
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install only production dependencies
|
# Install only production dependencies
|
||||||
COPY package*.json ./
|
COPY backend/package*.json ./
|
||||||
RUN npm ci --production
|
RUN npm ci --production
|
||||||
|
|
||||||
# Copy built files
|
# Copy built files
|
||||||
COPY --from=builder /app/build ./build
|
COPY --from=builder /app/backend/build ./build
|
||||||
COPY --from=builder /app/frontend/dist ./dist/frontend
|
COPY --from=builder /app/frontend/dist ./dist/frontend
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -3,13 +3,21 @@ VERSION := $(shell git describe --always --dirty)
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build --workspaces
|
||||||
|
|
||||||
|
.PHONY: dev
|
||||||
|
dev:
|
||||||
|
npm run dev
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run:
|
||||||
npm run start
|
npm run start
|
||||||
|
|
||||||
|
.PHONY: image
|
||||||
|
image:
|
||||||
|
docker build -t queuecube:$(VERSION)-$(shell uname -m) .
|
||||||
|
|
||||||
.PHONY: images
|
.PHONY: images
|
||||||
images:
|
images:
|
||||||
docker buildx build --platform linux/arm/v7 -t musicqueue:$(VERSION)-armv7l .
|
docker buildx build --platform linux/arm/v7 -t queuecube:$(VERSION)-armv7l .
|
||||||
docker buildx build --platform linux/amd64 -t musicqueue:$(VERSION)-amd64 .
|
docker buildx build --platform linux/amd64 -t queuecube:$(VERSION)-amd64 .
|
||||||
|
|||||||
2121
backend/package-lock.json
generated
Normal file
2121
backend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
32
backend/package.json
Normal file
32
backend/package.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "mpvqueue",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "build/server.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc -b",
|
||||||
|
"dev": "concurrently \"tsc -w -p src\" \"nodemon build/server.js\"",
|
||||||
|
"start": "node build/index.js"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": "",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/express": "^5.0.0",
|
||||||
|
"@types/express-ws": "^3.0.5",
|
||||||
|
"@types/node": "^22.13.4",
|
||||||
|
"@types/ws": "^8.5.14",
|
||||||
|
"concurrently": "^9.1.2",
|
||||||
|
"nodemon": "^3.1.9",
|
||||||
|
"typescript": "^5.7.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node-fetch": "^2.6.12",
|
||||||
|
"classnames": "^2.5.1",
|
||||||
|
"express": "^4.21.2",
|
||||||
|
"express-ws": "^5.0.2",
|
||||||
|
"link-preview-js": "^3.0.14",
|
||||||
|
"node-fetch": "^2.7.0",
|
||||||
|
"react-icons": "^5.4.0",
|
||||||
|
"ws": "^8.18.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -107,10 +107,10 @@
|
|||||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"], // Only include backend files
|
"include": ["src/**/*"], // Only include backend files
|
||||||
"exclude": ["frontend/**/*"], // Explicitly exclude frontend files
|
"exclude": ["../frontend/**/*"], // Explicitly exclude frontend files
|
||||||
"files": [],
|
"files": [],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "./src" }, // Backend reference
|
{ "path": "./src" }, // Backend reference
|
||||||
{ "path": "./frontend" } // Frontend reference
|
{ "path": "../frontend" } // Frontend reference
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
7683
package-lock.json
generated
7683
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
40
package.json
40
package.json
@@ -1,32 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mpvqueue",
|
"name": "queuecube",
|
||||||
"version": "1.0.0",
|
"version": "1.82",
|
||||||
"main": "build/server.js",
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -b && cd frontend && npm run build",
|
"dev": "concurrently \"cd frontend && npm run dev\" \"cd backend && npm run dev\""
|
||||||
"dev": "concurrently \"cd frontend && npm run dev\" \"tsc -w -p src\" \"nodemon build/server.js\"",
|
},
|
||||||
"start": "node build/index.js"
|
"workspaces": [
|
||||||
},
|
"backend",
|
||||||
"author": "",
|
"frontend"
|
||||||
"license": "ISC",
|
]
|
||||||
"description": "",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/express": "^5.0.0",
|
|
||||||
"@types/express-ws": "^3.0.5",
|
|
||||||
"@types/node": "^22.13.4",
|
|
||||||
"@types/ws": "^8.5.14",
|
|
||||||
"concurrently": "^9.1.2",
|
|
||||||
"nodemon": "^3.1.9",
|
|
||||||
"typescript": "^5.7.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node-fetch": "^2.6.12",
|
|
||||||
"classnames": "^2.5.1",
|
|
||||||
"express": "^4.21.2",
|
|
||||||
"express-ws": "^5.0.2",
|
|
||||||
"link-preview-js": "^3.0.14",
|
|
||||||
"node-fetch": "^2.7.0",
|
|
||||||
"react-icons": "^5.4.0",
|
|
||||||
"ws": "^8.18.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user