Commit 4c041766 authored by nanahira's avatar nanahira

update

parent 3d23c953
Pipeline #41328 passed with stages
in 8 minutes and 16 seconds
FROM node:lts-trixie-slim as base FROM node:lts-trixie-slim as base
LABEL Author="Nanahira <nanahira@momobako.com>" LABEL Author="Nanahira <nanahira@momobako.com>"
RUN apt update && apt -y install python3 build-essential libpq-dev && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/*
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN apt update && apt -y install curl ca-certificates gnupg2 && \
curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo 'deb https://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list && \
apt update && \
apt -y install python3 build-essential git google-chrome-stable libnss3 libfreetype6-dev libharfbuzz-bin libharfbuzz-dev ca-certificates fonts-freefont-otf fonts-freefont-ttf fonts-noto-cjk fonts-noto-cjk-extra fonts-wqy-microhei fonts-wqy-zenhei xvfb libpq-dev && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/*
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ./package*.json ./ COPY ./package*.json ./
......
FROM node:lts-trixie-slim as base
LABEL Author="Nanahira <nanahira@momobako.com>"
RUN apt update && apt -y install python3 build-essential libpq-dev && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/*
WORKDIR /usr/src/app
COPY ./package*.json ./
FROM base as builder
RUN npm ci && npm cache clean --force
COPY . ./
RUN npm run build
FROM base
ENV NODE_ENV production
RUN npm ci && npm cache clean --force
COPY --from=builder /usr/src/app/dist ./dist
COPY ./config.example.yaml ./config.yaml
ENV NODE_PG_FORCE_NATIVE=true
EXPOSE 3000
CMD [ "npm", "run", "start:prod" ]
FROM node:lts-trixie-slim as base
LABEL Author="Nanahira <nanahira@momobako.com>"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN apt update && apt -y install curl ca-certificates gnupg2 && \
curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo 'deb https://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list && \
apt update && \
apt -y install python3 build-essential git google-chrome-stable libnss3 libfreetype6-dev libharfbuzz-bin libharfbuzz-dev ca-certificates fonts-freefont-otf fonts-freefont-ttf fonts-noto-cjk fonts-noto-cjk-extra fonts-wqy-microhei fonts-wqy-zenhei xvfb && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/*
WORKDIR /usr/src/app
COPY ./package*.json ./
FROM base as builder
RUN npm ci && npm cache clean --force
COPY . ./
RUN npm run build
FROM base
ENV NODE_ENV production
RUN npm ci && npm cache clean --force
COPY --from=builder /usr/src/app/dist ./dist
COPY ./config.example.yaml ./config.yaml
EXPOSE 3000
CMD [ "npm", "run", "start:prod" ]
...@@ -12,4 +12,6 @@ npm install --save-dev \ ...@@ -12,4 +12,6 @@ npm install --save-dev \
jest \ jest \
@types/jest \ @types/jest \
ts-jest \ ts-jest \
rimraf rimraf \
esbuild \
esbuild-register
...@@ -2,25 +2,36 @@ ...@@ -2,25 +2,36 @@
"name": "myproject", "name": "myproject",
"description": "myproject-desc", "description": "myproject-desc",
"version": "1.0.0", "version": "1.0.0",
"main": "dist/index.js", "main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"scripts": { "scripts": {
"lint": "eslint --fix .", "lint": "eslint --fix .",
"build": "rimraf dist && tsc", "compile:cjs": "esbuild index.ts --outfile=dist/index.cjs --bundle --sourcemap --platform=node --target=es2019 --external:*",
"compile:esm": "esbuild index.ts --outfile=dist/index.mjs --bundle --sourcemap --platform=neutral --target=esnext --external:*",
"compile:types": "tsc --emitDeclarationOnly --declaration",
"build": "rimraf dist && npm run compile:cjs && npm run compile:esm && npm run compile:types",
"test": "jest --passWithNoTests", "test": "jest --passWithNoTests",
"start": "node dist/index.js" "start": "node dist/index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://code.mycard.moe/3rdeye/myproject.git" "url": "https://code.moenext.com/nanahira/myproject.git"
}, },
"author": "Nanahira <nanahira@momobako.com>", "author": "Nanahira <nanahira@momobako.com>",
"license": "MIT", "license": "MIT",
"keywords": [], "keywords": [],
"bugs": { "bugs": {
"url": "https://code.mycard.moe/3rdeye/myproject/issues" "url": "https://code.moenext.com/nanahira/myproject/issues"
}, },
"homepage": "https://code.mycard.moe/3rdeye/myproject", "homepage": "https://code.moenext.com/nanahira/myproject",
"jest": { "jest": {
"moduleFileExtensions": [ "moduleFileExtensions": [
"js", "js",
......
...@@ -2,4 +2,5 @@ __pycache__ ...@@ -2,4 +2,5 @@ __pycache__
*.pyc *.pyc
*.pyo *.pyo
venv venv
*.http *.http
\ No newline at end of file .venv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment