This commit is contained in:
2026-07-01 16:40:33 +05:00
parent 783de4e040
commit 6bc9f7d933
6 changed files with 77 additions and 6 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
node_modules
.git
data
.env
*.log
.gitignore

7
Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM node:20-alpine
RUN apk add --no-cache git
WORKDIR /app
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["npm", "start"]

35
docker-compose.yml Normal file
View File

@@ -0,0 +1,35 @@
services:
gia-gve-certificates:
build: .
image: gia-gve-certificates
container_name: gia-gve-certificates
# ports:
# - "3000:3000"
networks:
- applications
volumes:
- /docker/data:/app/data
environment:
- TZ=Asia/Yekaterinburg
- GIT_REPO_URL=https://git.dadehard.ru/kalugin66/gia-gve-certificates.git
- SESSION_SECRET=change_me_to_a_random_string
- LDAP_AUTH_URL=https://ldap.itschool25.ru/api/auth
- PORT=3000
- USER_1_LOGIN=admin
- USER_1_PASSWORD=changeme
- USER_1_NAME=Administrator
- USER_1_EMAIL=kalugin66@ya.ru
- USER_1_ROLE=admin
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 5s
retries: 3
networks:
applications:
external: true
# docker-compose up -d --build

23
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -e
if [ -n "$GIT_REPO_URL" ]; then
if [ -d /app/.git ]; then
cd /app
git stash --include-untracked 2>/dev/null || true
git pull origin master 2>&1
else
rm -rf /app
git clone "$GIT_REPO_URL" /app
fi
fi
cd /app
mkdir -p data
if [ -z "$(ls node_modules 2>/dev/null)" ]; then
echo "Installing dependencies..."
npm install --omit=dev
fi
exec "$@"

8
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "diplom-certificates",
"version": "1.1.0",
"name": "gia-gve-certificates",
"version": "0.3.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "diplom-certificates",
"version": "1.1.0",
"name": "gia-gve-certificates",
"version": "0.3.1",
"dependencies": {
"bcryptjs": "~2.4.3",
"connect-sqlite3": "^0.9.16",

View File

@@ -1,6 +1,6 @@
{
"name": "diplom-certificates",
"version": "1.1.0",
"name": "gia-gve-certificates",
"version": "0.3.1",
"description": "Сервис для формирования справок ГИА и ГВЭ",
"main": "server.js",
"scripts": {