feat: add deploy instructions

This commit is contained in:
Kentai Radiquum 2025-05-30 15:59:58 +05:00
parent 79fb473998
commit 97a70690bb
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
16 changed files with 376 additions and 24 deletions

180
DEPLOYMENT.RU.md Normal file
View file

@ -0,0 +1,180 @@
# Развёртывание приложения AniX
## Vercel
Требования:
- аккаунт GitHub
- аккаунт Vercel
1. сделайте форк репозитория
![fork button](./docs/deploy/fork.png)
2. Войдите в аккаунт vercel
> [!IMPORTANT]
>Аккаунт Vercel должен быть связан с аккаунтом Github.
>
>Если у вас нет аккаунта vercel, то создайте его через вход с помощью Github.
3. Нажмите кнопку создать новый проект
![vercel new project button](./docs/deploy/vercel_new_project.png)
4. Нажмите кнопку импортировать напротив названия репозитория
![vercel import button](./docs/deploy/vercel_import.png)
5. (опционально) добавьте переменные для использования своего плеере:
- NEXT_PUBLIC_KODIK_PARSER_URL
- NEXT_PUBLIC_ANILIBRIA_PARSER_URL
- NEXT_PUBLIC_SIBNET_PARSER_URL
на те которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md)
![vercel project settings](./docs/deploy/vercel_project.png)
6. нажмите кнопку "Deploy" и ожидайте пока не появиться подтверждение
7. нажмите кнопку "Continue to Dashboard"
8. клиент будет доступен по ссылке такого вида, нажмите на неё что-бы его открыть
![vercel project url](./docs/deploy/vercel_url.png)
## Netlify
Требования:
- аккаунт GitHub
- аккаунт Netlify
1. сделайте форк репозитория
![fork button](./docs/deploy/fork.png)
2. Войдите в аккаунт netlify
> [!IMPORTANT]
>Аккаунт Netlify должен быть связан с аккаунтом Github.
>
>Если у вас нет аккаунта Netlify, то создайте его через вход с помощью Github.
3. Нажмите кнопку создать новый проект
![netlify new project button](./docs/deploy/netlify_new_project.png)
4. Нажмите кнопку GitHub
![netlify provider choice](./docs/deploy/netlify_provider.png)
5. Нажмите на название репозитория
![netlify import button](./docs/deploy/netlify_import.png)
6. (опционально) заполните название проекта
![netlify project name](./docs/deploy/netlify_project_name.png)
7. (опционально) добавьте переменные для использования своего плеере:
- NEXT_PUBLIC_KODIK_PARSER_URL
- NEXT_PUBLIC_ANILIBRIA_PARSER_URL
- NEXT_PUBLIC_SIBNET_PARSER_URL
на те которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md)
1. ![alt text](./docs/deploy/netlify_env_1.png)
2. ![alt text](./docs/deploy/netlify_env_2.png)
8. нажмите кнопку "Deploy" и ожидайте пока не появиться подтверждение
9. клиент будет доступен по ссылке такого вида, нажмите на неё что-бы его открыть
![netlify project url](./docs/deploy/netlify_url.png)
## Docker
Требования:
- [docker](https://docs.docker.com/engine/install/)
### Пре-билд
1. выполните комманду:
`docker run -d --name anix -p 3000:3000 radiquum/anix:latest`
### Ручной билд
Доп. Требования:
- [git](https://git-scm.com/)
1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX`
2. Переместитесь в директорию репозитория `cd AniX`
3. Выполните команду `docker build -t anix .`
4. После окончания, выполните команду: `docker run -d --restart always --name anix -p 3000:3000 anix`
### docker/Обозначения
- -d - запустить контейнер в фоне
- --restart always - всегда запускать после перезагрузки сервера
- --name - название контейнера
- -p - порт контейнера который будет доступен из вне. ПОРТ:3000
>[!NOTE]
> для переменных которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md), необходимо использовать `-e ПЕРЕМЕННАЯ=ЗНАЧЕНИЕ` до слова anix
[команда docker run](https://docs.docker.com/reference/cli/docker/container/run/)
### docker/После развёртывания
Сервис будет доступен по адресу: `http://<ВАШ IP><:ВАШ ПОРТ>/`
### docker/Примечание
Для использования своего домена и поддержки протокола https, вы можете использовать traefik или другой reverse-proxy, с сертификатом SSL.
Полезные ссылки:
- [Конвертер из команды docker run в синтакс для docker compose](https://it-tools.tech/docker-run-to-docker-compose-converter)
- [Как настроить traefik + свой домен + SSL](https://letmegooglethat.com/?q=how+to+setup+traefik+with+custom+domain+and+ssl+certificate+from+lets+encrypt%3F)
## pm2
Требования:
- [git](https://git-scm.com/)
- [nodejs 23+ с npm](http://nodejs.org/)
- [pm2](https://pm2.keymetrics.io/)
Инструкция:
1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX`
2. Переместитесь в директорию репозитория `cd AniX`
3. Выполните команду `npm install`
4. (опционально) скопируйте .env.sample как .env и заполните его переменными которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md)
5. Выполните команду `npm run build`
6. создайте новую директорию
7. переместите в созданную директорию
- директорию `public` в `./новая/public`
- директорию `.next/static` в `./новая/.next/static`
- файлы из `.next/standalone` в `./новая`
8. Переместитесь в созданную директорию и выполните команду `pm2 start server.js -n anix`
### pm2/Обозначения
- -n - название сервиса в pm2
### pm2/После развёртывания
Сервис будет доступен по адресу: `http://<ВАШ IP>:3000/`
### pm2/Примечание
Для автоматического запуска приложения, рекомендуется настроить pm2 на автозапуск, с помощью команды: `pm2 startup`
Полезные ссылки:
- [PM2: подходим к вопросу процесс-менеджмента с умом @ Habr](https://habr.com/ru/articles/480670/)

180
DEPLOYMENT.md Normal file
View file

@ -0,0 +1,180 @@
# AniX Application Deployment
## Vercel
Requirements:
- GitHub account
- Vercel account
1. Fork the repository
![fork button](./docs/deploy/fork.png)
2. Log in to your Vercel account
> [!IMPORTANT]
>Your Vercel account must be linked with your GitHub account.
>
>If you don't have a Vercel account, create one by signing in with GitHub.
3. Click the button to create a new project
![vercel new project button](./docs/deploy/vercel_new_project.png)
4. Click the import button next to the repository name
![vercel import button](./docs/deploy/vercel_import.png)
5. (optional) Add variables to use your own player:
- NEXT_PUBLIC_KODIK_PARSER_URL
- NEXT_PUBLIC_ANILIBRIA_PARSER_URL
- NEXT_PUBLIC_SIBNET_PARSER_URL
Use the ones you received if you deployed [anix-player-parsers](./player-parsers/README.md)
![vercel project settings](./docs/deploy/vercel_project.png)
6. Click the "Deploy" button and wait until you see a confirmation
7. Click the "Continue to Dashboard" button
8. The client will be available at a link of this form, click it to open
![vercel project url](./docs/deploy/vercel_url.png)
## Netlify
Requirements:
- GitHub account
- Netlify account
1. Fork the repository
![fork button](./docs/deploy/fork.png)
2. Log in to your Netlify account
> [!IMPORTANT]
>Your Netlify account must be linked with your GitHub account.
>
>If you don't have a Netlify account, create one by signing in with GitHub.
3. Click the button to create a new project
![netlify new project button](./docs/deploy/netlify_new_project.png)
4. Click the GitHub button
![netlify provider choice](./docs/deploy/netlify_provider.png)
5. Click the repository name
![netlify import button](./docs/deploy/netlify_import.png)
6. (optional) Fill in the project name
![netlify project name](./docs/deploy/netlify_project_name.png)
7. (optional) Add variables to use your own player:
- NEXT_PUBLIC_KODIK_PARSER_URL
- NEXT_PUBLIC_ANILIBRIA_PARSER_URL
- NEXT_PUBLIC_SIBNET_PARSER_URL
Use the ones you received if you deployed [anix-player-parsers](./player-parsers/README.md)
1. ![alt text](./docs/deploy/netlify_env_1.png)
2. ![alt text](./docs/deploy/netlify_env_2.png)
8. Click the "Deploy" button and wait until you see a confirmation
9. The client will be available at a link of this form, click it to open
![netlify project url](./docs/deploy/netlify_url.png)
## Docker
Requirements:
- [docker](https://docs.docker.com/engine/install/)
### Pre-built
1. Run the command:
`docker run -d --name anix -p 3000:3000 radiquum/anix:latest`
### Manual build
Additional Requirements:
- [git](https://git-scm.com/)
1. Clone the repository `git clone https://github.com/Radiquum/AniX`
2. Navigate to the repository directory `cd AniX`
3. Run the command `docker build -t anix .`
4. Once finished, run the command: `docker run -d --restart always --name anix -p 3000:3000 anix`
### docker/Flags
- -d - run container in background
- --restart always - always restart after server reboot
- --name - container name
- -p - container port to be exposed externally. PORT:3000
>[!NOTE]
> For variables you received if you deployed [anix-player-parsers](./player-parsers/README.md), you need to use `-e VARIABLE=VALUE` before the word anix
[docker run command](https://docs.docker.com/reference/cli/docker/container/run/)
### docker/After deployment
The service will be available at: `http://<YOUR IP><:YOUR PORT>/`
### docker/Note
To use your own domain and support HTTPS protocol, you can use traefik or another reverse proxy with SSL certificate.
Useful links:
- [Converter from docker run command to docker compose syntax](https://it-tools.tech/docker-run-to-docker-compose-converter)
- [How to setup traefik + custom domain + SSL](https://letmegooglethat.com/?q=how+to+setup+traefik+with+custom+domain+and+ssl+certificate+from+lets+encrypt%3F)
## pm2
Requirements:
- [git](https://git-scm.com/)
- [nodejs 23+ with npm](http://nodejs.org/)
- [pm2](https://pm2.keymetrics.io/)
Instructions:
1. Clone the repository `git clone https://github.com/Radiquum/AniX`
2. Navigate to the repository directory `cd AniX`
3. Run the command `npm install`
4. (optional) copy `.env.sample` as `.env` and fill it with variables you received if you deployed [anix-player-parsers](./player-parsers/README.md)
5. Run the command `npm run build`
6. Create a new directory
7. Move into the new directory:
- move `public` directory to `./new/public`
- move `.next/static` directory to `./new/.next/static`
- move files from `.next/standalone` to `./new`
8. Move into the created directory and run the command `pm2 start server.js -n anix`
### pm2/Flags
- -n - service name in pm2
### pm2/After deployment
The service will be available at: `http://<YOUR IP>:3000/`
### pm2/Note
To enable automatic application startup, it is recommended to configure pm2 to start on boot using the command: `pm2 startup`
Useful links:
- [PM2: managing processes smartly @ Habr](https://habr.com/ru/articles/480670/)

BIN
docs/deploy/fork.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
docs/deploy/netlify_url.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
docs/deploy/vercel_url.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View file

@ -36,8 +36,7 @@
>
> Из-за данной специфики, парсеры невозможно развернуть на edge сервисах, таких как CloudFlare Workers или Deno, а только на отдельном сервере.
<details>
<summary>С помощью docker</summary>
### Docker
Требования:
@ -61,18 +60,18 @@
4. Выполните команду `docker build -t anix-player-parser .`
5. После окончания, выполните команду: `docker run -d --restart always --name anix-player -p 7000:7000 anix-player-parser`
### Обозначения
### docker/Обозначения
- -d - запустить контейнер в фоне
- --restart always - всегда запускать после перезагрузки сервера
- --name - название контейнера
- -p - порт контейнера который будет доступен из вне. ПОРТ:7000
### После развёртывания
### docker/После развёртывания
Сервис будет доступен по адресу: `http://<ВАШ IP><:ВАШ ПОРТ>/`
### Примечание
### docker/Примечание
Для использования своего домена и поддержки протокола https, вы можете использовать traefik или другой reverse-proxy, с сертификатом SSL.
@ -83,8 +82,7 @@
</details>
<details>
<summary>С помощью pm2</summary>
### pm2
Требования:
@ -100,20 +98,18 @@
4. Выполните команду `npm install`
5. После окончания, Выполните команду `pm2 start index.ts -n anix-player-parser`
### Обозначения
### pm2/Обозначения
- -n - название сервиса в pm2
### После развёртывания
### pm2/После развёртывания
Сервис будет доступен по адресу: `http://<ВАШ IP>:7000/`
### Примечание
### pm2/Примечание
Для автоматического запуска приложения, рекомендуется настроить pm2 на автозапуск, с помощью команды: `pm2 startup`
Полезные ссылки:
- [PM2: подходим к вопросу процесс-менеджмента с умом @ Habr](https://habr.com/ru/articles/480670/)
</details>

View file

@ -36,8 +36,7 @@ Response:
>
> Because of this specificity, the parsers cannot be deployed on edge services like CloudFlare Workers or Deno, only on a dedicated server.
<details>
<summary>Using docker</summary>
### Docker
Requirements:
@ -61,18 +60,18 @@ Additional Requirements:
4. Run the command `docker build -t anix-player-parser .`
5. Once finished, run the command: `docker run -d --restart always --name anix-player -p 7000:7000 anix-player-parser`
### Legend
### docker/Legend
- -d - run the container in background
- --restart always - always restart after server reboot
- --name - container name
- -p - container port accessible externally. PORT:7000
### After deployment
### docker/After deployment
The service will be available at: `http://<YOUR IP><:YOUR PORT>/`
### Note
### docker/Note
To use your own domain and support the https protocol, you can use traefik or another reverse-proxy with an SSL certificate.
@ -83,8 +82,7 @@ Useful links:
</details>
<details>
<summary>Using pm2</summary>
### pm2
Requirements:
@ -100,20 +98,18 @@ Instructions:
4. Run the command `npm install`
5. Once finished, Run the command `pm2 start index.ts -n anix-player-parser`
### Legend
### pm2/Legend
- -n - service name in pm2
### After deployment
### pm2/After deployment
The service will be available at: `http://<YOUR IP>:7000/`
### Note
### pm2/Note
To enable automatic application start, it is recommended to configure pm2 to start on boot with the command: `pm2 startup`
Useful links:
- [PM2: smart approach to process management @ Habr](https://habr.com/ru/articles/480670/)
</details>