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)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# HTTPS cerificates
|
||||
/cert/
|
||||
*.pem
|
||||
|
||||
# K8S test files
|
||||
/k8s/
|
||||
# development files
|
||||
/secrets/
|
||||
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,
|
||||
"license": "UNLICENSED",
|
||||
"scripts": {
|
||||
"build": "nest build",
|
||||
"build": "nest build && npx prisma generate",
|
||||
"format": "prettier --write \"src/**/*.ts\"",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||
"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,
|
||||
};
|
||||
|
||||
export const httpsConstants = {
|
||||
certPath: process.env.CERT_PEM_PATH,
|
||||
keyPath: process.env.KEY_PEM_PATH,
|
||||
};
|
||||
|
||||
export const apiConstants = {
|
||||
port: +(process.env.API_PORT ?? 5050),
|
||||
version: process.env.SERVER_VERSION,
|
||||
|
||||
@@ -42,14 +42,14 @@ async function bootstrap() {
|
||||
});
|
||||
|
||||
swaggerDocument.servers = [
|
||||
{
|
||||
url: "https://polytechnic-dev.n08i40k.ru",
|
||||
description: "Сервер для разработки и тестирования",
|
||||
},
|
||||
{
|
||||
url: "https://polytechnic.n08i40k.ru",
|
||||
description: "Сервер для продакшн окружения",
|
||||
},
|
||||
{
|
||||
url: "https://polytechnic-dev.n08i40k.ru",
|
||||
description: "Сервер для разработки и тестирования",
|
||||
},
|
||||
];
|
||||
|
||||
SwaggerModule.setup("api-docs", app, swaggerDocument, {});
|
||||
|
||||
Reference in New Issue
Block a user