From d918de0386697ca61af4400b1e2350b085048be4 Mon Sep 17 00:00:00 2001 From: NW Date: Sat, 14 Dec 2024 13:46:03 +0000 Subject: [PATCH] docker file update --- Dockerfile | 8 +++++--- docker-compose.yml | 31 +++++++++++++++++-------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecb18bf..e7f667c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,12 @@ FROM node:22 WORKDIR /app +# Копируем только package.json и package-lock.json для установки зависимостей COPY package*.json /app/ -COPY src/ /app/src/ -#COPY db/shop.db /app/shop.db +# Устанавливаем зависимости RUN npm install -CMD ["node", "src/index.js"] +# Исходный код и другие файлы будут синхронизироваться через volume mounts + +CMD ["node", "src/index.js"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f915c89..87c2c8d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,20 @@ version: "3.3" services: - telegram_shop_prod: - build: - context: . - dockerfile: ./Dockerfile - hostname: telegram_shop_prod - container_name: telegram_shop_prod - restart: always - environment: - - BOT_TOKEN=7626758249:AAEdcbXJpW1VsnJJtc8kZ5VBsYMFR242wgk - - ADMIN_IDS=732563549,390431690,217546867 - - SUPPORT_LINK=https://t.me/neroworm - - CATALOG_PATH=./catalog - volumes: - - ./db:/app/db/ \ No newline at end of file + telegram_shop_prod: + build: + context: . + dockerfile: ./Dockerfile + hostname: telegram_shop_prod + container_name: telegram_shop_prod + restart: always + environment: + - BOT_TOKEN=7626758249:AAEdcbXJpW1VsnJJtc8kZ5VBsYMFR242wgk + - ADMIN_IDS=732563549,390431690,217546867 + - SUPPORT_LINK=https://t.me/neroworm + - CATALOG_PATH=./catalog + volumes: + - ./db:/app/db/ # Синхронизация базы данных + - ./src:/app/src/ # Синхронизация исходного кода + - ./package.json:/app/package.json # Синхронизация package.json + - ./package-lock.json:/app/package-lock.json # Синхронизация package-lock.json \ No newline at end of file