forked from bookpauk/inpx-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавил создание docker контейнера. ``` docker build -t inpx-web . docker run -v /path/to/library:/library -v /path/to/library/flibusta.inpx:/app/data/index.inpx -p 12380:12380 inpx-web ``` Внутри контейнера создаётся пользователь inpx-web и id=1000 и сервер запускается под этим пользователем. Важно: запускать контейнер и монтировать внутрь папки с архивами в `/library` и файл inpx в `/app/data/index.inpx`. сloses bookpauk#16
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN useradd -ms /bin/bash -u 1000 -U -d /app inpx-web | ||
|
||
RUN set -e \ | ||
&& apt update \ | ||
&& apt -y upgrade \ | ||
&& apt install -y --no-install-recommends curl wget zip ca-certificates \ | ||
&& curl -sL https://deb.nodesource.com/setup_20.x | bash \ | ||
&& apt install -y --no-install-recommends nodejs \ | ||
&& apt clean | ||
|
||
RUN set -e \ | ||
&& npm install \ | ||
&& npm run build:client \ | ||
&& node build/prepkg.js linux \ | ||
&& mkdir -p /app/data \ | ||
&& chown -R inpx-web:inpx-web /app \ | ||
&& mkdir -p /library \ | ||
&& rm ./server/config/application_env \ | ||
&& echo "chown -R inpx-web:inpx-web /app" | ||
|
||
RUN echo "#!/bin/bash" >> /entrypoint.sh \ | ||
&& echo "set -e" >> /entrypoint.sh \ | ||
&& echo "su inpx-web -c \"node server --lib-dir=/library --app-dir=/app/data --inpx=/app/data/index.inpx --recreate\"" >> /entrypoint.sh \ | ||
&& chmod +x /entrypoint.sh | ||
|
||
EXPOSE 12380 | ||
|
||
HEALTHCHECK CMD curl --fail http://localhost:12380 || exit 1 | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters