diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/editor.iml b/.idea/editor.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/.idea/editor.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..03d9549e --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..8780e863 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..cbdf356b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2e97c398 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +# ---- Базовый образ с Bun ---- +FROM oven/bun:1 AS base +WORKDIR /app + +# ---- Установка зависимостей ---- +FROM base AS deps +COPY package.json bun.lockb ./ +COPY apps/editor/package.json ./apps/editor/ +COPY packages/*/package.json ./packages/ +RUN bun install --frozen-lockfile + +# ---- Сборка проекта ---- +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . + +# Сборка через Turbo +RUN bun run build + +# ---- Продакшен образ ---- +FROM base AS runner +WORKDIR /app + +ENV NODE_ENV=production +ENV PORT=3002 + +# Копируем собранное приложение и необходимые файлы +COPY --from=builder /app/apps/editor/.next /app/apps/editor/.next +COPY --from=builder /app/apps/editor/public /app/apps/editor/public +COPY --from=builder /app/apps/editor/package.json /app/apps/editor/package.json +COPY --from=builder /app/node_modules /app/node_modules +COPY --from=builder /app/package.json /app/package.json + +# Устанавливаем рабочую директорию для Next.js +WORKDIR /app/apps/editor + +EXPOSE 3002 + +CMD ["bun", "run", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..cef2886c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.8' + +services: + editor: + build: + context: . + dockerfile: Dockerfile + container_name: pascal-editor + restart: unless-stopped + ports: + - "3002:3002" + environment: + - NODE_ENV=production + - PORT=3002 + # При необходимости можно подключить переменные окружения из файла + # env_file: + # - .env.local \ No newline at end of file