mirror of
https://github.com/matrixgpt/matrix-chatgpt-bot.git
synced 2024-06-14 17:12:43 +00:00
Update and simplify Docker
This commit is contained in:
parent
bfe62dac54
commit
72a746aac5
17
Dockerfile
17
Dockerfile
|
@ -1,8 +1,7 @@
|
||||||
FROM satantime/puppeteer-node:18.12.1-slim
|
FROM satantime/puppeteer-node:18.13.0-slim
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/app/Downloads
|
RUN mkdir -p /usr/src/app/Downloads
|
||||||
|
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
||||||
|
@ -14,28 +13,22 @@ RUN apt update -qq \
|
||||||
&& apt install -qq -y --no-install-recommends \
|
&& apt install -qq -y --no-install-recommends \
|
||||||
chromium \
|
chromium \
|
||||||
dumb-init \
|
dumb-init \
|
||||||
# To run Headful mode, you will need to have a display, which is not present in a server.
|
# To run Headful mode we just need to install Xvfb and Puppeteer related dependencies.
|
||||||
# To avoid this, we will use Xvfb, and create a fake display, so the chrome will think there is a display and run properly.
|
xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic \
|
||||||
# So we just need to install Xvfb and Puppeteer related dependencies.
|
xvfb xauth\
|
||||||
x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps xvfb xauth\
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& rm -rf /src/*.deb
|
&& rm -rf /src/*.deb
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
RUN yarn install --frozen-lockfile --production && yarn cache clean
|
RUN yarn install --frozen-lockfile --production && yarn cache clean
|
||||||
|
|
||||||
COPY ./tsconfig.json ./tsconfig.json
|
COPY ./tsconfig.json ./tsconfig.json
|
||||||
|
|
||||||
COPY ./src ./src
|
COPY ./src ./src
|
||||||
|
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
VOLUME /storage
|
VOLUME /storage
|
||||||
|
|
||||||
ENV DATA_PATH="/storage"
|
ENV DATA_PATH="/storage"
|
||||||
|
|
||||||
# We run a fake display and run our script.
|
# We run a fake display and run our script using Xvfb
|
||||||
# Start script on Xvfb
|
|
||||||
CMD xvfb-run --server-args="-screen 0 1024x768x24" yarn start
|
CMD xvfb-run --server-args="-screen 0 1024x768x24" yarn start
|
|
@ -7,7 +7,7 @@
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "v18.12.1"
|
"node": ">=18.12.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rm -f tsconfig.tsbuildinfo && npx tsc",
|
"build": "rm -f tsconfig.tsbuildinfo && npx tsc",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user