🏗️ Updated Dockerfile
This commit is contained in:
63
Dockerfile
63
Dockerfile
@@ -1,40 +1,61 @@
|
|||||||
FROM alpine:3.14
|
# Use a base image with Node.js 22.1.0
|
||||||
|
FROM node:22.1.0
|
||||||
|
|
||||||
|
# Set metadata for contact
|
||||||
LABEL maintainer="Rishi Ghan <rishi.ghan@gmail.com>"
|
LABEL maintainer="Rishi Ghan <rishi.ghan@gmail.com>"
|
||||||
|
|
||||||
# Show all node logs
|
# Set environment variables
|
||||||
ENV NPM_CONFIG_LOGLEVEL warn
|
ENV NPM_CONFIG_LOGLEVEL warn
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
WORKDIR /core-services
|
WORKDIR /core-services
|
||||||
|
|
||||||
|
# Install required packages
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libvips-tools \
|
||||||
|
wget \
|
||||||
|
imagemagick \
|
||||||
|
python3 \
|
||||||
|
xvfb \
|
||||||
|
xz-utils \
|
||||||
|
curl \
|
||||||
|
bash \
|
||||||
|
software-properties-common
|
||||||
|
|
||||||
RUN apk add --update \
|
# Install p7zip
|
||||||
--repository http://nl.alpinelinux.org/alpine/v3.14/main \
|
RUN apt-get update && apt-get install -y p7zip
|
||||||
vips-tools \
|
|
||||||
wget \
|
|
||||||
imagemagick \
|
|
||||||
python3 \
|
|
||||||
unrar \
|
|
||||||
p7zip \
|
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
xvfb \
|
|
||||||
xz
|
|
||||||
|
|
||||||
|
# Install unrar directly from RARLAB
|
||||||
|
RUN wget https://www.rarlab.com/rar/rarlinux-x64-621.tar.gz \
|
||||||
|
&& tar -zxvf rarlinux-x64-621.tar.gz \
|
||||||
|
&& cp rar/unrar /usr/bin/ \
|
||||||
|
&& rm -rf rarlinux-x64-621.tar.gz rar
|
||||||
|
|
||||||
|
# Clean up package lists
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Verify Node.js installation
|
||||||
|
RUN node -v && npm -v
|
||||||
|
|
||||||
|
# Copy application configuration files
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
COPY moleculer.config.ts ./
|
COPY moleculer.config.ts ./
|
||||||
COPY tsconfig.json ./
|
COPY tsconfig.json ./
|
||||||
|
|
||||||
RUN npm i
|
# Install application dependencies
|
||||||
# Install Dependncies
|
RUN npm install
|
||||||
RUN npm install -g typescript ts-node
|
RUN npm install -g typescript ts-node
|
||||||
|
|
||||||
|
# Copy the rest of the application files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build and cleanup
|
# Build and clean up
|
||||||
RUN npm run build \
|
RUN npm run build \
|
||||||
&& npm prune
|
&& npm prune
|
||||||
|
|
||||||
|
|
||||||
|
# Expose the application's port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
# Start server
|
|
||||||
CMD ["npm", "start"]
|
# Command to run the application
|
||||||
|
CMD ["npm", "start"]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default class ImageTransformation extends Service {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
public constructor(
|
public constructor(
|
||||||
public broker: ServiceBroker,
|
public broker: ServiceBroker,
|
||||||
schema: ServiceSchema<{}> = { name: "imagetransformation" }
|
schema: ServiceSchema<{}> = { name: "torrentjobs" }
|
||||||
) {
|
) {
|
||||||
super(broker);
|
super(broker);
|
||||||
this.parseServiceSchema({
|
this.parseServiceSchema({
|
||||||
@@ -77,7 +77,7 @@ export default class ImageTransformation extends Service {
|
|||||||
"qbittorrent.getTorrentRealTimeStats",
|
"qbittorrent.getTorrentRealTimeStats",
|
||||||
{ infoHashes }
|
{ infoHashes }
|
||||||
);
|
);
|
||||||
// 4. Emit the LS_COVER_EXTRACTION_FAILED event with the necessary details
|
// 4.
|
||||||
await this.broker.call("socket.broadcast", {
|
await this.broker.call("socket.broadcast", {
|
||||||
namespace: "/",
|
namespace: "/",
|
||||||
event: "AS_TORRENT_DATA",
|
event: "AS_TORRENT_DATA",
|
||||||
|
|||||||
Reference in New Issue
Block a user