mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
Сборка Docker image
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
scripts
|
||||||
|
README.md
|
||||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -55,9 +55,5 @@ pids
|
|||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
# HTTPS cerificates
|
# development files
|
||||||
/cert/
|
/secrets/
|
||||||
*.pem
|
|
||||||
|
|
||||||
# K8S test files
|
|
||||||
/k8s/
|
|
||||||
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM node:current-alpine3.19
|
||||||
|
LABEL authors="n08i40k"
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm i --omit=dev
|
||||||
|
RUN npm i prisma
|
||||||
|
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
ENTRYPOINT ["sh", "-c", "/scripts/start.sh"]
|
||||||
|
CMD ["npm", "run", "start:prod"]
|
||||||
13162
package-lock.json
generated
Normal file
13162
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nest build",
|
"build": "nest build && npx prisma generate",
|
||||||
"format": "prettier --write \"src/**/*.ts\"",
|
"format": "prettier --write \"src/**/*.ts\"",
|
||||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||||
"precommit": "npm run format && npm run lint",
|
"precommit": "npm run format && npm run lint",
|
||||||
|
|||||||
11
scripts/start.sh
Normal file
11
scripts/start.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
DATABASE_URL="mongodb://$(cat "$MONGO_PROJECTDB_USERNAME_FILE"):$(cat "$MONGO_PROJECTDB_PASSWORD_FILE")@$MONGO_DOMAIN:$MONGO_PORT/$MONGO_INITDB_DATABASE?authMechanism=SCRAM-SHA-1"
|
||||||
|
export DATABASE_URL
|
||||||
|
|
||||||
|
JWT_SECRET=$(cat "$JWT_TOKEN_FILE")
|
||||||
|
export JWT_SECRET
|
||||||
|
|
||||||
|
npx prisma db push
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
@@ -27,11 +27,6 @@ export const jwtConstants = {
|
|||||||
secret: process.env.JWT_SECRET,
|
secret: process.env.JWT_SECRET,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const httpsConstants = {
|
|
||||||
certPath: process.env.CERT_PEM_PATH,
|
|
||||||
keyPath: process.env.KEY_PEM_PATH,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const apiConstants = {
|
export const apiConstants = {
|
||||||
port: +(process.env.API_PORT ?? 5050),
|
port: +(process.env.API_PORT ?? 5050),
|
||||||
version: process.env.SERVER_VERSION,
|
version: process.env.SERVER_VERSION,
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ async function bootstrap() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
swaggerDocument.servers = [
|
swaggerDocument.servers = [
|
||||||
{
|
|
||||||
url: "https://polytechnic-dev.n08i40k.ru",
|
|
||||||
description: "Сервер для разработки и тестирования",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
url: "https://polytechnic.n08i40k.ru",
|
url: "https://polytechnic.n08i40k.ru",
|
||||||
description: "Сервер для продакшн окружения",
|
description: "Сервер для продакшн окружения",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
url: "https://polytechnic-dev.n08i40k.ru",
|
||||||
|
description: "Сервер для разработки и тестирования",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
SwaggerModule.setup("api-docs", app, swaggerDocument, {});
|
SwaggerModule.setup("api-docs", app, swaggerDocument, {});
|
||||||
|
|||||||
Reference in New Issue
Block a user